Within your Master API Key Settings, you will be able to add IP Whitelists and enable specific API Key functions, separated into User, Account, and Trade. Let’s go over these functions in detail.

User Settings (Create a User/User API Key)

Create a User

Before you can start trading, we need to create a user who can interact with the exchange. This is easy to do with Shrimpy!

Note: These requests are signed with the master API keys.

Request

POST https://dev-api.shrimpy.io/v1/users

Request Body

{

"name": "customnameforthisuser"

}

Response

{

"id": "701e0d16-1e9e-42c9-b6a1-4cada1f395b8"

}

Create a User API Key

User API Keys can also be created for each user. Unlike Master API Keys, User API Keys are specifically designed to manage an individual user and can be shared with the associated user. This allows them to manage their own personal account with these keys by directly sending requests to Shrimpy.

Multiple exchange accounts can be linked to a single user API key. Therefore allowing one user to manage countless exchange accounts with a single user API key. This user API key can execute trades, collecting account information, or accessing full order book data across every connected exchange.

Note: These requests are signed with the master API keys

Request

POST https://dev-api.shrimpy.io/v1/users/<userId>/keys

Request Example:

POST https://dev-api.shrimpy.io/v1/users/701e0d16-1e9e-42c9-b6a1-4cada1f395b8/keys

Response:

{

"publicKey": "51ac18b7d208f59b3c88acbb1ecefe6ba6be6ea4edc07e7a2450307ddc27ab80",

"privateKey": "85c977ef4070f1deee70192ba7fd5a6caf534f891e4918cfffec11cd6b625e77db4f80347cb436bcaa8882231bacb02f0798a696f101fdd1ef268d66fc63c213"

}

Account Settings

In order to complete setup for trading, we also need to link an exchange account that we’ll be using to trade. Similar to our earlier example, we’ll be using Bittrex as the exchange we want to link.

Note: These requests can be signed with the user API keys.

Connect an Exchange Account

Request

POST https://dev-api.shrimpy.io/v1/users/<userId>/accounts

Request Example

Request Body

{

"exchange": "bittrex",

"publicKey": "GOelL5FT6TklPxAzICIQK25aqct52T2lHoKvtcwsFla5sbVXmeePqVJaoXmXI6Qd",

"privateKey": "SelUuFq1sF2zGd97Lmfbb4ghITeziKo9IvM5NltjEdffatRN1N5vfHXIU6dsqRQw",

}

Response

{

"id": 1234

}

Perfect! Now we have our user all set up. Let’s start trading!

Trading

Account Balances

In order to know which assets an account is holding on an exchange, we need to collect balance data. This can be done easily with Shrimpy.

Note: These requests can be signed with user API keys.

Request

GET https://dev-api.shrimpy.io/v1/users/<userId>/accounts/<exchangeAccountId>/balance

Request Example

Response

{

"retrievedAt": "2019-01-09T19:17:33.000Z",

"balances": [

{

"symbol": "KCS",

"nativeValue": 2306,

"btcValue": 0.33486579,

"usdValue": 1327.8775274784

},

{

"symbol": "ETH",

"nativeValue": 4.0e-8,

"btcValue": 1.4960564e-9,

"usdValue": 5.9324652822859e-6

}

]

}

Awesome! It was that simple to get the balances for our exchange account.

Execute Trades

Let’s see how easy it is to perform a trade with Shrimpy. We will use the following endpoint:

Request

POST https://dev-api.shrimpy.io/v1/users/<userId>/accounts/<exchangeAccountId>/trades

This endpoint provides a simple method to execute a single trade through the Shrimpy APIs. All we will need to do is specify the “from” asset, the “to” asset, and the “amount”. With this information, Shrimpy will intelligently route your trades through quote currencies (if necessary) to accomplish the trade.

Note: These requests can be signed with the user API keys.

Request Example

Request Body

{

"fromSymbol": "BTC",

"toSymbol": "ETH",

"amount": "0.01",

}

That’s it! You have now successfully submitted a trade through Shrimpy’s Trading API. Wasn’t that a piece of cake?

Now that we’ve gone through the process to execute a trade, let’s explore some other useful endpoints that are available.

Market Data

Now, you might be wondering how you can execute a trading strategy based on market data. Shrimpy can collect market data based on the complete order book or the ticker. In this example, we will look at the ticker. For order book data, please refer to our API documentation.

Request

GET https://dev-api.shrimpy.io/v1/exchanges/ <exchange> /ticker

Request Example

GET https://dev-api.shrimpy.io/v1/exchanges/kucoin/ticker

Response

[

{

"name": "Bitcoin",

"symbol": "BTC",

"priceUsd": "3700.0089335",

"priceBtc": "1",

"percentChange24hUsd": "4.191224354581092",

"lastUpdated": "2018-12-19T22:51:13.000Z"

},

{

"name": "Ethereum",

"symbol": "ETH",

"priceUsd": "100.114205389399",

"priceBtc": "0.027057825",

"percentChange24hUsd": "5.432113558652999",

"lastUpdated": "2018-12-19T22:51:13.000Z"

},

...

]

Start Building

These endpoints should be enough to start building many applications. If you have other features you need, check out the Shrimpy APIs for additional functionality. We support limit orders, open orders, full order book data, and much more. Each of these endpoints have different use cases.

To condense and simplify all of the steps above, we created a flowchart for Shrimpy’s Crypto Trading API below.

Summary

Let’s quickly walk through the steps we took to execute our first trade with Shrimpy.

Created a master key through the Shrimpy UI here.

Created a user.

Created user keys.

Linked an exchange.

Executed a trade.

Shrimpy API

Shrimpy offers the most advanced APIs for developers looking to integrate scalable crypto exchange trading functionality into their app.

Shrimpy’s Crypto Trading API was created as a cloud-based solution to address several crypto developer roadblocks including Exchange Trading, Product Scalability, and User Management. With Shrimpy’s API in hand, developers can focus on creating the next era of groundbreaking products that will shape the future of crypto.

Shrimpy’s API is readily compatible with the following exchanges and API endpoints: Binance API, CoinbasePro API, Bittrex API, Kraken API, Gemini API, Poloniex API, Huobi API, KuCoin API, Bibox API, BitMart API, and HitBTC API.

Traders and developers can leverage Shrimpy’s existing trading infrastructure for trading platform/app development instead of having to manage connections to each and every exchange.