Get a market
GET/api/v2/markets/{market}
One market's metadata, data coverage, location and settlement cycle
One request: one market. A successful response counts as one request
Parameters
| Name | In | Description |
|---|---|---|
marketrequired | path | Market id, as listed by GET /markets (for example nyse, lse, cme-equity-futures)Example: nyse |
Example
curl https://marketcalendars.com/api/v2/markets/nyse \
-H "Authorization: Bearer mc_live_..."const res = await fetch("https://marketcalendars.com/api/v2/markets/nyse", {
headers: { Authorization: `Bearer ${process.env.MARKETCALENDARS_KEY}` },
});
const data = await res.json();import os, requests
res = requests.get(
"https://marketcalendars.com/api/v2/markets/nyse",
headers={"Authorization": f"Bearer {os.environ['MARKETCALENDARS_KEY']}"},
)
data = res.json()GET /api/v2/markets/nyse200
{
"id": "nyse",
"name": "New York Stock Exchange",
"shortName": "NYSE",
"mic": "XNYS",
"type": "stocks",
"country": "United States",
"countryCode": "US",
"city": "New York",
"region": "americas",
"timezone": "America/New_York",
"parent": null,
"coverage": {
"from": "1995-01-01",
"to": "2051-12-31"
},
"url": "https://marketcalendars.com/markets/nyse",
"website": "https://www.nyse.com",
"location": {
"latitude": 40.7069,
"longitude": -74.0113
},
"aliases": [
"XNYS",
"NYSE"
],
"settlement": {
"available": true,
"cycle": "T+1",
"source": {
"name": "Federal Reserve holidays (DTC)",
"url": "https://www.federalreserve.gov/aboutthefed/k8.htm"
}
},
"dataSource": "pandas_market_calendars 5.5.0",
"sourceCalendar": "NYSE"
}A live response from the API. Lists longer than seven items are cut to three here
Response fields
MarketDetail object. Fields marked | null are always present and may be null
| Field | Type | Description |
|---|---|---|
| id | string | Market id used in every path |
| name | string | Full name |
| shortName | string | Short name or abbreviation |
| mic | string | null | ISO 10383 market identifier code |
| type | string | What the market tradesstocksfuturesoptionsbondsfxcrypto |
| country | string | Country name |
| countryCode | string | null | ISO 3166-1 alpha-2 |
| city | string | City of the exchange |
| region | string | Region, as on /regionsamericaseuropeasia-pacificmiddle-east-africa |
| timezone | string | IANA time zone |
| parent | string | null | Id of the primary market this is a sub-market of, such as cme for its product groups |
| coverage | object | Dates we have data for |
| coverage.from | string (date) | First date with data |
| coverage.to | string (date) | Last date with data |
| url | string (uri) | Market page on marketcalendars.com |
| website | string (uri) | null | Exchange website |
| location | object | null | Approximate exchange location |
| location.latitude | number | Degrees north |
| location.longitude | number | Degrees east |
| aliases | string[] | Other library codes that identify only this market |
| settlement | object | Settlement days we publish for the market |
| settlement.available | boolean | Whether we publish settlement days for this market |
| settlement.cycle | string | null | Settlement cycle in force today |
| settlement.source | object | null | Settlement calendar the days come from |
| settlement.source.name | string | Settlement calendar |
| settlement.source.url | string (uri) | Where the calendar is published |
| dataSource | string | Source library and version |
| sourceCalendar | string | Calendar name in the source library |
Errors
- 401unauthorizedThe Authorization header is missing, malformed, or names a revoked key
- 404unknown-marketNo market has that id. GET /markets lists every id
- 429rate-limitedThe key sent more requests in a minute than its plan's burst limit
- 429quota-exceededThe plan's requests for this period are used up