Using the REST API

The REST API follows standard REST patterns.

Applications can manage resources (seasons, fixtures, and player items) through HTTPS requests to corresponding URLs. For details on resources and operations, see the API Reference.

Authentication: To access resources in your account, use an access token provided by the support team. Application credentials are required for production and simulation environments and cannot be shared publicly.

Our REST API and WebSocket endpoints are only tailored for B2B use. Using our data to connect directly with the DDE is prohibited. This helps ensure data integrity and security. If you have integration needs, we can discuss proceeding within our guidelines. Please feel free to reach out with any questions to datasupport@imgarena.com.

Making API Calls: To perform operations on a resource, send an HTTPS request with the resource URL, appropriate headers (including the access token), method, request body, and query parameters.

Example cURL command:

curl https://dde-api.data.imgarena.com/snooker/seasons \
  -X GET \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'Content-Type: application/json'

Resource URL: Access resources using their URLs, which differ for production and simulation environments. For Production: https://dde-api.data.imgarena.com, and for Simulation: https://dde-api-sims.data.imgarena.com.

HTTP Methods: Specify the HTTP method in the request for actions on resources:

  • GET: Read or list resources

  • POST: Create resources

  • PUT: Update resources

  • DELETE: Delete resources

Headers and query parameters: Use HTTP headers and query parameters to provide additional information about the call, such as authorization and data format or for sorting, filtering, or paging in list operations. For example:. For example:

curl 'https://dde-api.data.imgarena.com/snooker/fixtures?status=Completed&type=Official' \
  -X GET \
  -H 'Authorization: Bearer {ACCESS_TOKEN}' \
  -H 'Accept: application/json' 

Response Handling: API calls return JSON objects with requested resources or an errors list. Success responses have an HTTP 200 status code, while errors have non-200 status codes.

For operations on a single object, the response contains a JSON object with the type of resource (e.g., season, fixture).

For list and search operations, the response includes a named array of objects (e.g., seasons) and a cursor value for pagination.

Ensure to check for the cursor value in list and search operations to retrieve all items.

For more information on handling errors, refer to the documentation on error handling.

Enrichment

In our REST API, every action packet undergoes an enrichment process where the player and team names are appended. However, our system will log a warning if the player or team associated with a specific fixture is not found within the enrichment packet. The warning will either state "Unknown player code: …" or "Unknown team code: …" depending on the missing element. In such cases, the system will substitute an empty string ("") instead of the actual name. This ensures that users are alerted to any discrepancies while maintaining the integrity of the data packet structure.

Last updated