Support Center

Overview of the Trading API

Last Updated: Feb 09, 2014 12:40PM GMT

Introduction

The Predictious Trading API allows you to programmatically trade on Predictious. You can get information about contracts, about your account (funds, shares...), place orders, etc...
 

Getting access to the Trading API

To get access to the Trading API, go to this page and click "Generate" to generate an API Key. That API key is linked to your account, and allows you to perform operations programmatically with your account.
 

Authentication

Accessing the API is done by sending a GET or POST request to an URL like https://api.predictious.com/v1/api_method, where api_method is the method you want to call. In order to call the Trading API, it is required to provide an API Key through the X-Predictious-Key HTTP header.

Example using CURL:

curl --header "X-Predictious-Key: 8q0PChSlewhJKm63EGm9LfMgRvpB62ZgWEOr+UX8PlbLj4/ZNPePKLvxBhmSJj2e3oZ3dEskBT516T3SybRT93d5jeKJJgns4QpTNrZdqx7G7nqNncpSGyuAR+WGisSkbYzpIlqiIyJsB9t55D8xR8KiGmY=" https://api.predictious.com/v1/contracts

Responses

Responses are encoded in JSON. See below for more details on individual API methods.

Prices: All amounts of money are integers representing a number of Satoshis.

 

API Methods

The following API methods are available:
 

GET:

POST:

For POST operations, you will need to specify a JSON body for the request. It is also required to specify the following HTTP header:

​Content-Type: application/json
  • Place orders for buying or selling shares: https://api.predictious.com/v1/addorders 
    The details of the orders should be passed in the body of the request in JSON format. The JSON document should look as follow:
    ​[{"ContractId":"<contractid>","IsAsk":<true|false>,"Quantity":<integer>,"Price":<integer>},...]
    ​The response is an array of string values representing the new order IDs.​
  • Cancel one or more open orders: https://api.predictious.com/v1/cancelorders 
    The details of the orders to be cancelled should be passed in the body of the request in JSON format. The JSON document should look as follow:
    [​{"Id":"<orderid>"},...]
    The response a an array of string values representing the order IDs that have been successfully cancelled.
support@predictious.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete