Skip to main content

Authentication

The Market Data API uses a Bearer Token for authentication. The token is a programmatic representation of your username and password credentials, so you must keep it secret just as you would your username and password. The token is required for each request you make to the API.

Obtaining a Token

To obtain it, sign-in to your customer dashboard using your username and password and request a token. It will be delivered by email to the address you used to sign-in.

Using the Token

There are two ways to pass this token to the API with your requests:

  1. Header Authentication
  2. URL Parameter Authentication
tip

We recommend using header-based authentication to ensure your token is not stored or cached. While Market Data makes a conscientious effort to delete tokens from our own server logs, we cannot guarantee that your token will not be stored by any of our third party cloud infrastructure partners.

Header Authentication

Add the token to the Authorization header using the word Bearer.

Code Examples

GET /v1/stocks/quotes/SPY/ HTTP/1.1
Host: api.marketdata.app
Accept: application/json
Authorization: Bearer {token}
tip

The curly braces around token are a placeholder for this example. Do not actually wrap your token with curly braces.

URL Parameter Authentication

Add the token as a variable directly in the URL using the format token=YOUR_TOKEN_HERE. For example:

https://api.marketdata.app/v1/stocks/quotes/SPY/?token={token}
tip

The curly braces around token are a placeholder for this example. Do not actually wrap your token with curly braces.

Demo The API With No Authentication

You can try stock, option, and index endpoints with several different symbols that are unlocked and do not require a token. Please be aware that only historical data for these tickers is available without a token.

  • Try any stock endpoint with AAPL, no token required.
  • Try any option endpoint with any AAPL contract, for example: AAPL271217C00250000. No token required.

IP Address Restrictions

Each account may only connect from one IP address at a time. You can switch devices, but you cannot use two devices simultaneously. Back-and-forth switching between IP addresses within a 5-minute window triggers a temporary block.

See the Single IP Address Policy for full details, or 403: Multiple IP Addresses if your account is blocked.