API Documentation

    API Documentation

    Access our financial data programmatically with our easy-to-use REST API

    Authentication Required

    Please sign in or create an account to use the API. The basic API is free to use for everyone.

    Sign In

    Getting Started

    Our API uses standard HTTP response codes, authentication with API keys, and returns JSON responses.

    Authentication

    You can authenticate your API requests in two ways:

    1. Using HTTP Headers

    Include your API token in the request header:

    X-API-Key: your_api_token

    2. Using Query Parameters

    Alternatively, you can pass your API token as a query parameter:

    https://api.markets.sh/api/v1/endpoint?api_token=your_api_token

    Note: Using the header method is recommended for production environments as it's more secure than exposing your token in URLs.

    Base URL

    https://api.markets.sh/api/v1

    Rate Limits

    API requests are limited based on your subscription plan. Free users get 30 requests per day, while premium users enjoy higher limits.

    API Reference

    Explore our comprehensive API endpoints to access financial data, news, and more.

    Please sign in or create an account to use the API

    The basic API is free to use for everyone. You can use it to build your own app. Please login to get your API token.

    GET

    Portfolios

    Retrieve the user's portfolios.

    Endpoint

    https://api.markets.sh/api/v1/u/portfolios

    Code Example

    Response

    Returns a list of the user's portfolios.

    Please sign in or create an account to use the API

    The basic API is free to use for everyone. You can use it to build your own app. Please login to get your API token.

    GET

    Get Data For Symbol

    Retrieve data for a specific stock symbol.

    Endpoint

    https://api.markets.sh/api/v1/symbols/NASDAQ:AAPL

    Code Example

    Response

    Returns detailed data for the specified stock symbol.

    Please sign in or create an account to use the API

    The basic API is free to use for everyone. You can use it to build your own app. Please login to get your API token.

    GET

    Get Daily Quotes For Symbol

    Fetch daily quotes for a specific stock symbol over a specified date range.

    Endpoint

    https://api.markets.sh/api/v1/symbols/NASDAQ:AAPL/quotes

    Parameters

    NameValueType
    from

    Start date for the daily quotes. Defaults to 1 year ago.

    query
    to

    End date for the daily quotes. Defaults to today.

    query

    Code Example

    Response

    Returns daily quotes for the specified stock symbol within the given date range.