Step 1: Create an API Key
In the CommodityAI dashboard, navigate to Settings → API Keys:- Click “Create API Key”
- Enter a descriptive name (e.g., “Production Integration” or “Development Key”)
- Select the environment:
live- Production datatest- Development and testing
- Copy the key immediately - it won’t be shown again!
Your API key format will be:
cai_live_a1b2c3d4... (live) or cai_test_a1b2c3d4... (test) followed by 64 hex characters.Step 2: Get Your Definition ID
To query data, you’ll need a definition ID for the records you want to access:- In the CommodityAI dashboard, go to Settings
- Navigate to Source Record Definitions or Custom Object Definitions
- Copy the UUID for the definition you want to query
Step 3: Make Your First API Request
Replace{definition-id} with your actual definition ID and use your API key:
Available Endpoints
- Source Records:
GET /api/v1/sources/{definition-id}/records - Custom Objects:
GET /api/v1/objects/{definition-id}/records
Understanding the Response
All responses follow this structure:Key Response Fields
data- Array of records matching your queryrecord_data- The extracted structured datametadata- Record status, confidence, timestampsmeta.has_more- Whether more pages existmeta.next_cursor- Token for fetching the next page
Common Query Parameters
Customize your requests with these parameters:limit- Records per page (default: 100, max: 1000)cursor- Pagination token from previous responserecord_counter[gte]- Filter by counter (e.g.,record_counter[gte]=5)created_at[gte]- Filter by timestamp (e.g.,created_at[gte]=2024-01-01T00:00:00Z)
Next Steps
Authentication
Learn about API key security and best practices
API Endpoints
Explore full API endpoint documentation
Rate Limits
Understand rate limiting and headers
Error Handling
Handle errors and edge cases
Need Help?
- API Questions: Check the API Reference for detailed documentation
- Technical Support: Contact [email protected]
- Issues: Report bugs or request features through your account manager
