Postman collection

Every SockOdds API v1 request, ready to send from Postman.

What is in it

The collection at /postman.json has one request for each HTTP operation in the API reference, from listSports to listResults, generated from the same OpenAPI contract. Every request sends your key in the Authorization: Bearer header.

The odds stream is a WebSocket, so it is not in the collection. See streaming for how to connect to it.

Import it

  1. Open Postman and choose Import.
  2. Paste https://sockodds.com/postman.json as a link, or download /postman.json and drop the file in.
  3. Postman adds a collection called SockOdds API v1.

Set the two variables

The collection uses two collection variables. Open the collection, then its Variables tab.

VariableSet it to
baseUrlhttps://api.sockodds.com/v1. It is filled in already.
sockoddsKeyYour SockOdds key. It is empty in the download.

Every request's URL starts with {{baseUrl}}, and every request's Authorization header is Bearer {{sockoddsKey}}, so you set the key once and every request uses it.

Keep the key in Postman's variables

  • Type the key into the variable only, never into a request's URL, header or body. That way it is not saved into the requests themselves.
  • Postman keeps two values for a variable: one that is shared when you share, sync or export the collection, and one that stays on your machine (the current value). Put the key in the one that stays on your machine, and leave the shared one empty.
  • Before you export the collection or share a workspace, check that the shared value of sockoddsKey is still empty.
  • If the key is ever shared by mistake, rotate it from your account.

Don't have a key yet? Create a free Developer key.

Send a request

  1. Open listSports and choose Send. You get the list of sports in {data, meta, links}.
  2. Open listEvents to see current games and copy an event id (it starts with ev_).
  3. Open getEventOdds, replace the example id in the URL with yours and send it. Add markets=winner in the Params tab to keep the response short.

The ids and dates in the collection's example URLs are placeholders: replace them with values from your own responses. When a list has more, links.next holds the full URL of the next page; paste it into a new request as it is.

Errors come back as application/problem+json, with a title and a detail that say what to fix. See errors.

Next steps

When you are ready to write code, the quickstart has the same requests in cURL, JavaScript and Python, and the examples show complete programs.

Search across the SockOdds documentation and catalogue.