Criteo Retail Media API SDK

raw JSON →
2026.1.0.260427 verified Fri May 01 auth: no python

Official Python SDK for the Criteo Retail Media API. Current version 2026.1.0.260427, with monthly releases aligned to the API version.

pip install criteo-api-retailmedia-sdk
error ModuleNotFoundError: No module named 'criteo_api_retailmedia_sdk'
cause Installed the wrong package or didn't install at all. The deprecated package 'criteo-api-retailmedia' or 'criteo' is different.
fix
Run 'pip install criteo-api-retailmedia-sdk' and use the correct import path.
error AttributeError: module 'criteo_api_retailmedia_sdk' has no attribute 'ApiClient'
cause Trying to import ApiClient from the deprecated location (e.g., criteo_api_retailmedia_sdk.api_client) or running an old SDK version.
fix
Update to the latest SDK and import 'from criteo_api_retailmedia_sdk import ApiClient'.
breaking The SDK release version (e.g., 2026.1.0.260427) must exactly match the target API version. Using a mismatched SDK can cause serialization/deserialization errors.
fix Verify the desired API version from Criteo docs and install the matching SDK version.
gotcha ApiClient requires both client_id and client_secret. Passing only one or using wrong environment (e.g., 'staging' vs 'production') leads to authentication failures.
fix Set both environment variables and ensure the environment parameter matches your contract.
deprecated The 'retail-media' package was renamed to 'criteo-api-retailmedia-sdk'. Old imports from 'criteo_marketing' or 'criteo_api_retailmedia' are invalid.
fix Use 'from criteo_api_retailmedia_sdk import ApiClient'.

Initialize the SDK client with credentials and call an API endpoint.

import os
from criteo_api_retailmedia_sdk import ApiClient
from criteo_api_retailmedia_sdk.api import AccountApi

client = ApiClient(
    client_id=os.environ.get('CRITEO_CLIENT_ID', ''),
    client_secret=os.environ.get('CRITEO_CLIENT_SECRET', ''),
    environment='production'
)
accounts_api = AccountApi(client)
try:
    response = accounts_api.get_accounts()
    print(response)
except Exception as e:
    print(f"Error: {e}")