← Home

Authentication

All requests to the Marketstack API must be authenticated using an access key. The access key identifies the client application and determines the level of access based on the selected subscription plan. It is passed as a query parameter with each API request.

Before you begin

Before making API requests, ensure that you have:

  • A valid Marketstack account
  • An active API access key
  • The base URL for the Marketstack API

Authenticate an API request

To authenticate a request, include the access_key parameter in the request URL.

  1. Start with the base API URL.
  2. Append the endpoint you want to access.
  3. Add the access_key query parameter with your API key value.
  4. Include any additional query parameters required by the endpoint.

Example:

The following example shows an authenticated request for end-of-day stock data:


/eod?access_key=YOUR_ACCESS_KEY&symbols=MSFT

Replace YOUR_ACCESS_KEY with your actual API key.

Note:
  • The access_key parameter is required for every request.
  • If the access key is missing or invalid, the API returns an authentication error.
  • For security reasons, do not expose your access key in public repositories or client-side code.
Next →