Documentation
Welcome to the API documentation - your comprehensive source for real-time and historical financial market data. Our API provides access to commodities, cryptocurrencies, forex rates, stock prices, and global market indexes.
https://api.28-markets.com/apiAuthentication
All API endpoints require a valid API key for authentication. You can obtain your API key by subscribing to a plan on our Pricing page. Once you have your API key, you can include it in your requests in two ways:
Method
cURL Example
Visit our Pricing page to subscribe to a plan and get your unique API key immediately.
Commodities
Access real-time and historical commodity prices including gold, silver, oil, natural gas, copper, and agricultural products. All endpoints require API key authentication and are rate-limited.
Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
GET /commodity/ | Get all commodities with their current prices | None |
GET /commodity/:code | Get a specific commodity by its code | code - Commodity code (e.g., GOLD, SILVER, OIL) |
GET /commodity/:code/history | Get complete price history for a commodity | code - Commodity code |
GET /commodity/:code/history/period/:period | Get price history for a specific time period | code - Commodity codeperiod - Time period (e.g., 1d, 1w, 1m, 3m, 6m, 1y) |
Example Response
Cryptocurrencies
Live and historical cryptocurrency data including prices, market caps, volume, and comprehensive market analysis. All endpoints require API key authentication and are rate-limited.
Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
GET /crypto/coin/ | Get all cryptocurrencies with current prices | None |
GET /crypto/coin/symbol/:symbol | Get a specific cryptocurrency by symbol | symbol - Crypto symbol (e.g., BTC, ETH, SOL) |
GET /crypto/coin/id/:id | Get a specific cryptocurrency by database ID | id - Database ID |
GET /crypto/coin/:symbol/history | Get price history for a cryptocurrency | symbol - Crypto symbol |
Example Response
Currencies (Forex)
Live and historical foreign exchange rates for major and minor currency pairs. All endpoints require API key authentication and are rate-limited.
Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
GET /forex/currency/ | Get all forex currency pairs with current rates | None |
GET /forex/currency/:code | Get a specific forex pair by its code | code - Currency pair (e.g., EURUSD, GBPUSD, USDJPY) |
GET /forex/currency/:code/history | Get complete exchange rate history for a currency pair | code - Currency pair code |
GET /forex/currency/:code/history/period/:period | Get exchange rate history for a specific time period | code - Currency pair codeperiod - Time period (e.g., 1d, 1w, 1m, 3m, 6m, 1y) |
Example Response
Stocks & Equity
Comprehensive stock market data including company profiles, statistics, dividends, earnings, financials, and price history. All endpoints require API key authentication and are rate-limited.
Company Information Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
GET /stocks/profiles/:company_id | Get company profile information | company_id - Company identifier |
GET /stocks/statistics/:company_id | Get company statistics (P/E ratio, market cap, etc.) | company_id - Company identifier |
GET /stocks/dividends/:company_id | Get dividend history for a company | company_id - Company identifier |
GET /stocks/earnings/:company_id | Get earnings reports for a company | company_id - Company identifier |
GET /stocks/financial/:company_id | Get financial statements for a company | company_id - Company identifier |
GET /stocks/holders/:company_id | Get institutional and insider holdings | company_id - Company identifier |
GET /stocks/company/:company_id/all | Get all data for a company in one request | company_id - Company identifier |
Price History Endpoints
| Endpoint | Description | Parameters |
|---|---|---|
GET /stocks/price-history/:company_id | Get complete price history for a company | company_id - Company identifier |
Example Response
All GET endpoints require API key authentication. You must include your API key in the request headers. Rate limits apply based on your subscription tier. Visit our Pricing page for detailed rate limit information.