Skip to content

Get spot prices

Goal

Request a spot price from executable streaming prices (ESP).

Prerequisites

  • Your REST API app.
  • Integral API login with trading permission.
  • Your organization provisioned with at least one provider who streams ESP spot prices.

Steps

Step 1: Login

Step 2: Get spot prices

Step 3: Handle prices

Step 1: Login

Step 2: Get spot prices

Step 3: Handle prices

Step 1: Login

Use the Login and get token endpoint.

See the related Login tutorial.

Your access token is in SSO_TOKEN of the response header. Your token is valid for limited time.

Pass the SSO_TOKEN cookie value with all of your subsequent API requests.

POST
/v2/sso/login
{ "user": "apiUserId", "pass": "This is a long password!", "org": "apiOrganizationId" }

Step 2: Get spot prices

Use the Get spot rate by symbol endpoint.

Use the rateId attribute of the JSON response in the next step.

GET
/v2/rates/spot
JavaScript
const query = new URLSearchParams({symbol: 'EUR/USD'}).toString();

const resp = await fetch(
  `/v2/rates/spot?${query}`,
  {
    method: 'GET',
    headers: {
      SSO_TOKEN: 'YOUR_API_KEY_HERE'
    }
  }
);

const data = await resp.text();
console.log(data);

Step 3: Handle prices

Use the rateId attribute of the response when you place your order.

POST
/v2/orders
{ "coId": "8932452311944", "type": "Limit", "side": "Buy", "symbol": "EUR/USD", "currency": "EUR", "size": 1000000, "price": 1.0971678, "timeInForce": "IOC" }