Files
prodigyapi/source/index.html.md
jasonzm46 e8dd59a980 jasonpre
2023-03-14 13:00:13 -07:00

5.0 KiB
Raw Blame History

title, language_tabs, toc_footers, includes, search, code_clipboard, meta
title language_tabs toc_footers includes search code_clipboard meta
API Reference
plaintext
<a href='#'>Sign Up for a Developer Key</a>
<a href='https://github.com/slatedocs/slate'>Documentation Powered by Slate</a>
errors
true true
name content
description Documentation for the Prodigy API

Prodigy API Documentation

Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.

We have language bindings in Shell, Ruby, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

This example API documentation page was created with Slate. Feel free to edit it and use it as a base for your own API's documentation.

Depth of Market Subscription (depth)

Gets depth data for a market.

Subscribe Message

Gets depth data for a market.

{
'user': 'g',
'action': 'subscribe',
'type': 'depth',
'value': ['BTC-USD'],
"token":"<provided by Prodigy>"
};

Response

The initial depth data response returns information about the market and its current buy and sell levels with data that describes the depth at each level.

Data Definition
Denominator Factor to divide by for USD value
available true
{
  "data": {
"Denominator":"100",
"DisplaySymbol":"BTC-USD",
"SecurityID":"1000000189",
"Symbol":"BTC-USD",
"buy_levels": [...
{
"NumOfOrders": "10",
"Price": "2037600",
"Qty": "4660000",
},
...],
"sell_levels": [...
{
"NumOfOrders": "7",
"Price": "2056150",
"Qty": "6370000",
},
...],
},
  "Type":3
}


Use the Logon <A> message to authenticate a user establishing a connection to a remote system. The Logon <A> message must be the first message sent by the application requesting to initiate a FIX session.

Setup a client-side stunnel to connect to Prodigys CLOB

Important environment variables:

export CLOB_HOST=clob-alpha.prodigy

export STUNNEL_PORT=[THE_LOCAL_PORT_TO_OPEN]

Kittens

Get All Kittens

require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.get
import kittn

api = kittn.authorize('meowmeowmeow')
api.kittens.get()
curl "http://example.com/api/kittens" \
  -H "Authorization: meowmeowmeow"
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let kittens = api.kittens.get();

The above command returns JSON structured like this:

[
  {
    "id": 1,
    "name": "Fluffums",
    "breed": "calico",
    "fluffiness": 6,
    "cuteness": 7
  },
  {
    "id": 2,
    "name": "Max",
    "breed": "unknown",
    "fluffiness": 5,
    "cuteness": 10
  }
]

This endpoint retrieves all kittens.

HTTP Request

GET http://example.com/api/kittens

Query Parameters

Parameter Default Description
include_cats false If set to true, the result will also include cats.
available true If set to false, the result will include kittens that have already been adopted.

Get a Specific Kitten

require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.get(2)
import kittn

api = kittn.authorize('meowmeowmeow')
api.kittens.get(2)
curl "http://example.com/api/kittens/2" \
  -H "Authorization: meowmeowmeow"
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.get(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "name": "Max",
  "breed": "unknown",
  "fluffiness": 5,
  "cuteness": 10
}

This endpoint retrieves a specific kitten.

HTTP Request

GET http://example.com/kittens/<ID>

URL Parameters

Parameter Description
ID The ID of the kitten to retrieve

Delete a Specific Kitten

require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.delete(2)
import kittn

api = kittn.authorize('meowmeowmeow')
api.kittens.delete(2)
curl "http://example.com/api/kittens/2" \
  -X DELETE \
  -H "Authorization: meowmeowmeow"
const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.delete(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "deleted" : ":("
}

This endpoint deletes a specific kitten.

HTTP Request

DELETE http://example.com/kittens/<ID>

URL Parameters

Parameter Description
ID The ID of the kitten to delete