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
- Open Postman and choose Import.
- Paste
https://sockodds.com/postman.jsonas a link, or download /postman.json and drop the file in. - 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.
| Variable | Set it to |
|---|---|
baseUrl | https://api.sockodds.com/v1. It is filled in already. |
sockoddsKey | Your 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
sockoddsKeyis 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
- Open
listSportsand choose Send. You get the list of sports in{data, meta, links}. - Open
listEventsto see current games and copy an eventid(it starts withev_). - Open
getEventOdds, replace the example id in the URL with yours and send it. Addmarkets=winnerin 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.