Available Markets API
Retrieve a list of all markets supported by the FinBrain API. Use this endpoint to discover available markets before querying for specific tickers.
Endpoint
Section titled “Endpoint”GET /v2/marketsAuthentication
Section titled “Authentication”Authenticate using one of the following methods (in order of recommendation):
| Method | Example |
|---|---|
| Bearer token (recommended) | Authorization: Bearer YOUR_API_KEY |
| X-API-Key header | X-API-Key: YOUR_API_KEY |
| Query parameter | ?apiKey=YOUR_API_KEY |
| Legacy query parameter | ?token=YOUR_API_KEY |
Parameters
Section titled “Parameters”This endpoint has no path or query parameters (aside from authentication).
Request
Section titled “Request”from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
markets = fb.available.markets(as_dataframe=True)print(markets)curl "https://api.finbrain.tech/v2/markets" \ -H "Authorization: Bearer YOUR_API_KEY"import requests
response = requests.get( "https://api.finbrain.tech/v2/markets", headers={"Authorization": "Bearer YOUR_API_KEY"})data = response.json()
for market in data["data"]["markets"]: print(f"{market['name']} ({market['region']})")#include <iostream>#include <string>#include <curl/curl.h>#include <nlohmann/json.hpp>
using json = nlohmann::json;
size_t WriteCallback(void* contents, size_t size, size_t nmemb, std::string* userp) { userp->append((char*)contents, size * nmemb); return size * nmemb;}
json get_available_markets(const std::string& api_key) { CURL* curl = curl_easy_init(); std::string response;
if (curl) { std::string url = "https://api.finbrain.tech/v2/markets"; std::string auth_header = "Authorization: Bearer " + api_key;
struct curl_slist* headers = nullptr; headers = curl_slist_append(headers, auth_header.c_str());
curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response); curl_easy_perform(curl); curl_slist_free_all(headers); curl_easy_cleanup(curl); }
return json::parse(response);}
int main() { auto result = get_available_markets("YOUR_API_KEY");
std::cout << "Available markets:" << std::endl; for (auto& market : result["data"]["markets"]) { std::cout << " - " << market["name"].get<std::string>() << " (" << market["region"].get<std::string>() << ")" << std::endl; }
return 0;}use reqwest::blocking::Client;use reqwest::header::{AUTHORIZATION, HeaderValue};use serde::Deserialize;use std::error::Error;
#[derive(Debug, Deserialize)]struct Market { name: String, region: String,}
#[derive(Debug, Deserialize)]struct MarketsData { markets: Vec<Market>,}
#[derive(Debug, Deserialize)]struct MarketsResponse { success: bool, data: MarketsData,}
fn get_available_markets(api_key: &str) -> Result<MarketsResponse, Box<dyn Error>> { let client = Client::new(); let response: MarketsResponse = client .get("https://api.finbrain.tech/v2/markets") .header(AUTHORIZATION, HeaderValue::from_str(&format!("Bearer {}", api_key))?) .send()? .json()?;
Ok(response)}
fn main() -> Result<(), Box<dyn Error>> { let data = get_available_markets("YOUR_API_KEY")?;
println!("Available markets:"); for market in &data.data.markets { println!(" - {} ({})", market.name, market.region); }
Ok(())}const response = await fetch("https://api.finbrain.tech/v2/markets", { headers: { "Authorization": "Bearer YOUR_API_KEY" }});const result = await response.json();
for (const market of result.data.markets) { console.log(`${market.name} (${market.region})`);}Response
Section titled “Response”Success Response (200 OK)
Section titled “Success Response (200 OK)”{ "success": true, "data": { "markets": [ { "name": "S&P 500", "region": "US" }, { "name": "NASDAQ", "region": "US" }, { "name": "DOW 30", "region": "US" }, { "name": "UK FTSE 100", "region": "UK" }, { "name": "Germany DAX", "region": "DE" }, { "name": "Crypto Currencies", "region": "Global" }, { "name": "Foreign Exchange", "region": "Global" } ] }, "meta": { "timestamp": "2026-01-19T15:05:55.187Z" }}Response Fields
Section titled “Response Fields”| Field | Type | Description |
|---|---|---|
success | boolean | Whether the request was successful |
data | object | Response data wrapper |
data.markets | array | List of available market objects |
data.markets[].name | string | Market name (use this value in other API calls) |
data.markets[].region | string | Geographic region of the market |
meta | object | Response metadata |
meta.timestamp | string | ISO 8601 timestamp of the response |
Available Markets
Section titled “Available Markets”| Market Name | Region |
|---|---|
| DOW 30 | US |
| S&P 500 | US |
| NASDAQ | US |
| NYSE | US |
| ETFs | US |
| UK FTSE 100 | UK |
| Germany DAX | DE |
| Canada TSX | Canada |
| Australia ASX | Australia |
| HK Hang Seng | Hong Kong |
| Mexico BMV | Mexico |
| Foreign Exchange | Global |
| Commodities | Global |
| Crypto Currencies | Global |
| Index Futures | Global |
| Tadawul TASI | Saudi Arabia |
| Russia MOEX | Russia |
| Brazil BOVESPA | Brazil |
| Tel Aviv TASE | Israel |
| OTC Market | US |
Usage Example
Section titled “Usage Example”Use the markets endpoint to dynamically build a market selector:
import requests
headers = {"Authorization": "Bearer YOUR_API_KEY"}
# Get available marketsresponse = requests.get("https://api.finbrain.tech/v2/markets", headers=headers)result = response.json()
# Build market selectorprint("Available Markets:")for i, market in enumerate(result["data"]["markets"], 1): print(f" {i}. {market['name']} ({market['region']})")
# Use a selected market to get tickersselected_market = result["data"]["markets"][0]["name"]tickers_resp = requests.get( "https://api.finbrain.tech/v2/tickers", headers=headers, params={"market": selected_market, "type": "daily"})tickers = tickers_resp.json()print(f"\n{selected_market} tickers: {len(tickers['data']['tickers'])}")Errors
Section titled “Errors”| Code | Error | Description |
|---|---|---|
| 401 | Unauthorized | Invalid or missing API key |
| 500 | Internal Server Error | Server-side error |
Related Endpoints
Section titled “Related Endpoints”- Available Tickers - Get tickers for a market
- Market Predictions - Get predictions for a market