Quick Start
Everything you need to start using the Commodity Fundamentals API.
Base URL
All API requests are made to the following base URL:
https://commodityfundamentals.com/api/v1
Authentication
Authenticate your API requests by including your API key. You can pass it as a Bearer token in the
Authorization
header, or as a query parameter.
Bearer Token (recommended)
Authorization: Bearer YOUR_API_KEY
Query Parameter
https://commodityfundamentals.com/api/v1/commodities?api_key=YOUR_API_KEY
Quick Start
Here's a quick example to get you started. Fetch a list of available commodities:
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://commodityfundamentals.com/api/v1/commodities?category=energy"
import requests
response = requests.get(
"https://commodityfundamentals.com/api/v1/commodities",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"category": "energy"}
)
data = response.json()
print(data["data"][0]["name"]) # "WTI Crude Oil"
Response Format
All responses are returned as JSON. Successful responses wrap the requested data in a
data envelope.
List endpoints include a meta
object with pagination info. Error responses use a consistent structure described in the
Error Handling section.
Every response includes the following headers:
| Header | Description |
|---|---|
| X-RateLimit-Limit | Daily request limit for your plan tier |
| X-RateLimit-Remaining | Requests remaining in current daily window |
| X-RateLimit-Reset | Unix timestamp when the rate limit resets |
Pagination
Endpoints that return lists support offset-based pagination via
page and
per_page parameters.
{
"data": [...],
"meta": {
"page": 1,
"per_page": 25,
"total": 142,
"total_pages": 6
}
}