Documentation
DataMine API
DataMine offers a secure REST API to programmatically access your purchased historical data with a CME Group API ID.
Table of Contents
1. Authentication
All requests to the API require authentication. Both OAuth 2.0 or Basic Auth are supported per your existing entitled API ID.
OAuth 2.0 (Bearer token): To authenticate, obtain an access token and include it in the authorization header as a Bearer token. To generate the access token, do so through the OAuth 2.0 Access Token endpoint:
https://auth.cmegroup.com/as/token.oauth2
Note: Tokens expire after 30 minutes
Header Example: Authorization: Bearer <YOUR_ACCESS_TOKEN_HERE>
Basic Authentication: To authenticate, provide your username and password encoded in the Authorization header.
2. File API and Parameters
You can download a file that you have access to using this API call.
File Download Base URL: https://datamine.new.cmegroup.com/cme/api/v2/download
Parameters
| Parameter Name | Type | Description | Example value |
|---|---|---|---|
| fid | string |
Unique file ID code by category / product. Format of: YYYYMMDD-{file_detail} A list of File IDs are available from:
|
20250625-EOD_XCBT_C_FUT_0_ETH_P |
Sample Requests
- https://datamine.new.cmegroup.com/cme/api/v2/download?fid=20240923-SOFRT_TermRate_Fixings_0_CSV
- https://datamine.new.cmegroup.com/cme/api/v2/download?fid=20250625-EOD_XCBT_C_FUT_0_ETH_P
Sample Code
Generating OAuth Access Token (Python)
Python
import requests
token_url = 'https://auth.cmegroup.com/as/token.oauth2'
api_id = '<API ID>'
api_password= '<API Password>'
def get_access_token (token_url, api_id, api_password):
response = requests.post(
token_url,
data={"grant_type": "client_credentials"},
auth=(api_id, api_password),
)
return response.json()["access_token"]
access_token = get_access_token(token_url, api_id, api_password)
Requesting Data (Python)
Python
datamine_url = 'https://datamine.new.cmegroup.com/cme/api/v2/download?'
file_id = '<INSERT FILE ID>'
headers = {"Authorization": f"Bearer {access_token}"}
params={"fid": file_id}
response = requests.get(datamine_url, headers=headers, params=params)
print(response.text)
Requesting Data (Python) - for large file handling
Python
output_file_path = './output.dat'
def save_file_from_api_response(api_response, output_path):
with open(output_path, 'wb') as f:
for chunk in api_response.iter_content(chunk_size=8192):
if chunk:
f.write(chunk)
headers = {"Authorization": f"Bearer {access_token}"}
params={"fid": file_id}
response = requests.get(datamine_url, headers=headers, params=params, stream=True)
save_file_from_api_response(response, output_file_path)
Requesting Data (cURL) - for large file handling
Shell
curl -L "https://datamine.new.cmegroup.com/cme/api/v2/download?fid={file_id}" -u "{client_id}:{client_password}" -OJ
Please note the use of the -L cURL command, in particular for larger files exceeding 100MB. It’s optional for requests less than 100MB.
3. DataMine List API
The DataMine List API allows the querying of all entitled files, with information on available files, sizes, the DataMine File Download API URL, and other meta data. The API updates in real-time giving you the most up-to-date view of your accessible files, such as when a new daily file is made available.
DataMine’s List API Service uses the same API credentials as the File Download API and is provisioned with your access by default.
Key features:
- Ability to list entitled files available for download.
- Filtering to see which files are available by dataset or other parameters.
- Real-time updates to the list of files available.
Documentation: https://www.cmegroup.com/datamine/datamine-list-api.html
Base List API URL: https://datamine.new.cmegroup.com/api/list_entitlements_files
4. Error Handling
The DataMine List API uses standard HTTP status codes to indicate the success or failure of an API request. In case of an error, the response body will contain a JSON object with details about the error.
| HTTP status code | Error code | Description |
| 200 OK | (N/A) | The request was successful. |
| 400 Bad Request | INVALID_INPUT | The request was malformed or had invalid parameters/headers. |
| 401 Unauthorized | UNAUTHORIZED | Authentication credentials were missing or invalid. |
| 403 Forbidden | ACCESS_DENIED | The authenticated user does not have permission to access the resource. |
| 404 Not Found | RESOURCE_NOT_FOUND | The requested file/file path could not be found. |
| 429 Too Many Requests | RATE_LIMIT_EXCEEDED | The client has sent too many requests in a given amount of time. |
| 500 Internal Server Error | INTERNAL_ERROR | An unexpected error occurred on the server. |
5. Changelog
| Version | Date | Description |
| 1.0 | Nov 1, 2024 | Initial release of documentation. |
| 1.1 | July 1, 2025 | Minor updates to documentation to add details around the DataMine List API, File IDs, and error handling. |
| 1.2 | July 23, 2025 | Update sample calls for large files. |