Documentation
DataMine API
DataMine offers a secure data download REST API to programmatically access your purchased historical data with a CME Group API ID.
Download
You can download a file that you have access to using this API call.
Endpoints:
- DataMine URL: https://datamine.new.cmegroup.com/cme/api/v2/download
- Access Token URL: https://auth.cmegroup.com/as/token.oauth2
Criteria
NAME |
DESCRIPTION |
REQUIRED |
TYPE |
---|---|---|---|
fid |
File IDs are available from the Order History page under My Account. The fid format is: yyyymmdd-dataset_exch_symbol_foi_spread-venue foi possible value:
spread possible value:
Example: 20240107-bbo_xcme_sp_fut_0-rth |
Yes |
String |
A list of File IDs (fid) is available here for download.
Connection Sample Code
Generating OAuth Access Token (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, client_id, client_secret)
Requesting Data (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)