Skip to content

Trade API Quickstart

From a set of client credentials to your first authenticated call. Ten minutes, two requests.

Before you start

You need three things, all issued by Nui Markets during onboarding:

  1. A client ID and client secret.
  2. The solution id for the marketplace you are trading in.
  3. The scopes your integration needs, for example solution:abc123:trades:read.

Credentials are not self-served. To request them, contact support@nuimarkets.com.

Keep the endpoint list open beside this page: https://api.nuimarkets.com/docs/api is generated from the API's own specification, and What you can automate covers using that specification to generate a client instead of writing requests by hand.

Step 1: exchange your credentials for a token

curl -s -X POST https://api.nuimarkets.com/api/1.0/token \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{"grant_type": "client_credentials"}'
{
  "access_token": "<token>",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": ["solution:abc123:trades:read", "solution:abc123:tenders:read"]
}

Check scope covers what you intend to call. It is the list of scopes your client was granted, which is not the same as what it can do: enforcement both adds and removes entries, so read the two rules that surprise people before treating it as the last word. A missing scope is still the usual cause of a 403 on an otherwise correct request.

Cache the token until expires_in runs down. Do not fetch one per call.

Step 2: make an authenticated call

Send the token as a bearer token. This lists trades for one solution:

curl -s "https://api.nuimarkets.com/api/1.0/trades?solution=$SOLUTION_ID" \
  -H "Authorization: Bearer $ACCESS_TOKEN"

A 200 returns a paginated collection. A 204 means the request was fine and there were no trades to return, which is a normal answer rather than an error.

Step 3: walk the collection

{
  "total": 128,
  "pages": 3,
  "_links": {
    "current": "/api/1.0/trades?solution=abc123&page=1",
    "next": "/api/1.0/trades?solution=abc123&page=2",
    "last": "/api/1.0/trades?solution=abc123&page=3"
  }
}

Follow _links.next until it is absent. The server maximum is 50 objects per page, and all timestamps are UTC in ISO 8601. Paging is by offset, so a collection changing underneath you can shift records between pages; see Reading and polling data if that matters to you.

That is the whole loop. Everything past this point is detail.

Next

Before you write anything beyond a script, read these two:

  • Rate limits. Three limits apply at once, and the concurrency limit of 2 is the one that breaks a parallelised backfill.
  • Reading and polling data. If-Modified-Since is how you keep a system in step without refetching collections.

Then, as you need them:


Updated 2026-10