EOD Historical Data Economic Data API

Economic events and macro indicators

OpenAPI Specification

eod-historical-economic-data-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: EODHD Financial Data Calendar Economic Data API
  description: Comprehensive API for retrieving financial data including stock prices, fundamentals, calendar events, news, and more from EOD Historical Data (eodhd.com)
  version: 2.0.0
  contact:
    name: EODHD Support
    url: https://eodhd.com
    email: supportlevel1@eodhistoricaldata.com
  termsOfService: https://eodhd.com/financial-apis/terms-conditions
  license:
    name: Proprietary
    url: https://eodhd.com/financial-apis/terms-conditions
servers:
- url: https://eodhd.com/api
  description: Primary API path
- url: https://eodhistoricaldata.com/api
  description: Alternative API path
security:
- EODHDQueryKey: []
tags:
- name: Economic Data
  description: Economic events and macro indicators
paths:
  /commodities/historical/{code}:
    get:
      summary: Get historical commodity prices
      description: Returns historical price data for a specific commodity by its code (e.g., WTI, BRENT, NATURAL_GAS).
      operationId: GetCommodityHistoricalData
      parameters:
      - name: code
        in: path
        required: true
        description: Commodity code (e.g., 'WTI', 'BRENT', 'NATURAL_GAS', 'GOLD', 'SILVER', 'COPPER', 'PLATINUM', 'PALLADIUM', 'WHEAT', 'CORN', 'SOYBEANS', 'RICE', 'SUGAR', 'COFFEE', 'COTTON', 'COCOA', 'OATS', 'LUMBER', 'RUBBER', 'ETHANOL', 'PROPANE', 'URANIUM', 'COAL').
        schema:
          type: string
      - name: api_token
        in: query
        required: true
        description: API token for authentication.
        schema:
          type: string
      - name: interval
        in: query
        required: false
        description: Data interval — 'daily' (default), 'weekly', or 'monthly'.
        schema:
          type: string
          enum:
          - daily
          - weekly
          - monthly
          default: daily
      - name: from
        in: query
        required: false
        description: Start date in 'YYYY-MM-DD' format.
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: false
        description: End date in 'YYYY-MM-DD' format.
        schema:
          type: string
          format: date
      - name: fmt
        in: query
        required: false
        description: Output format.
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: Successfully retrieved commodity historical data.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    date:
                      type: string
                      format: date
                      description: Data date.
                    open:
                      type: number
                      description: Opening price.
                    high:
                      type: number
                      description: High price.
                    low:
                      type: number
                      description: Low price.
                    close:
                      type: number
                      description: Closing price.
                    adjusted_close:
                      type: number
                      description: Adjusted closing price.
                    volume:
                      type: number
                      description: Trading volume.
        '400':
          description: Invalid request parameters.
        '401':
          description: Unauthorized. Invalid API token.
        '404':
          description: Commodity not found.
      tags:
      - Economic Data
  /economic-events:
    get:
      summary: Retrieve economic events data
      description: Fetches economic events by date range, country, comparison type, and other optional parameters.
      operationId: GetEconomicEventsData
      parameters:
      - name: api_token
        in: query
        required: true
        description: Your API key for authentication.
        schema:
          type: string
      - name: from
        in: query
        required: false
        description: Start date for data retrieval in 'YYYY-MM-DD' format.
        schema:
          type: string
          format: date
      - name: to
        in: query
        required: false
        description: End date for data retrieval in 'YYYY-MM-DD' format.
        schema:
          type: string
          format: date
      - name: country
        in: query
        required: false
        description: Country code in ISO 3166-1 alpha-2 format, e.g., 'US' for the United States.
        schema:
          type: string
          minLength: 2
          maxLength: 2
      - name: comparison
        in: query
        required: false
        description: Comparison type, e.g., 'mom' for month-over-month, 'qoq' for quarter-over-quarter, 'yoy' for year-over-year.
        schema:
          type: string
          enum:
          - mom
          - qoq
          - yoy
      - name: offset
        in: query
        required: false
        description: Data offset, from 0 to 1000. Default is 0.
        schema:
          type: integer
          minimum: 0
          maximum: 1000
          default: 0
      - name: limit
        in: query
        required: false
        description: Number of results to return, from 0 to 1000. Default is 50.
        schema:
          type: integer
          minimum: 0
          maximum: 1000
          default: 50
      responses:
        '200':
          description: Successfully retrieved economic events data.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    type:
                      type: string
                      description: Type of economic event, e.g., 'Nonfarm Payrolls'.
                    comparison:
                      type:
                      - string
                      - 'null'
                      description: Comparison type (e.g., 'mom', 'qoq', 'yoy').
                    period:
                      type:
                      - string
                      - 'null'
                      description: Period associated with the data, e.g., 'May'.
                    country:
                      type: string
                      description: Country code in ISO 3166 format.
                    date:
                      type: string
                      format: date-time
                      description: Date and time of the event in 'YYYY-MM-DD HH:MM:SS' format.
                    actual:
                      type:
                      - number
                      - 'null'
                      description: Actual reported value for the event.
                    previous:
                      type:
                      - number
                      - 'null'
                      description: Previous value for the event.
                    estimate:
                      type:
                      - number
                      - 'null'
                      description: Estimated value for the event.
                    change:
                      type:
                      - number
                      - 'null'
                      description: Change in value from previous.
                    change_percentage:
                      type:
                      - number
                      - 'null'
                      description: Percentage change in value from previous.
              example:
              - type: Participation Rate
                comparison: ''
                period: May
                country: US
                date: '2022-06-03 16:30:00'
                actual: 62.3
                previous: 62.2
                estimate: ''
                change: 0.1
                change_percentage: 0.161
              - type: Nonfarm Payrolls Private
                comparison: ''
                period: May
                country: US
                date: '2022-06-03 16:30:00'
                actual: 333
                previous: 405
                estimate: 325
                change: -72
                change_percentage: -17.778
        '400':
          description: Invalid request parameters.
        '401':
          description: Unauthorized. Invalid API token.
        '404':
          description: No economic events data found for the specified parameters.
      tags:
      - Economic Data
  /macro-indicator/{country}:
    get:
      summary: Retrieve macroeconomic indicators for a specific country
      description: Fetches macroeconomic data for a selected indicator, such as GDP or inflation, by country code.
      operationId: GetMacroIndicatorData
      parameters:
      - name: country
        in: path
        required: true
        description: Country code in ISO Alpha-3 format (e.g., 'USA' for United States, 'FRA' for France).
        schema:
          type: string
      - name: api_token
        in: query
        required: true
        description: Your API token for authentication.
        schema:
          type: string
      - name: indicator
        in: query
        required: false
        description: The macroeconomic indicator to retrieve. Default is 'gdp_current_usd'.
        schema:
          type: string
          enum:
          - real_interest_rate
          - population_total
          - population_growth_annual
          - inflation_consumer_prices_annual
          - consumer_price_index
          - gdp_current_usd
          - gdp_per_capita_usd
          - gdp_growth_annual
          - debt_percent_gdp
          - net_trades_goods_services
          - inflation_gdp_deflator_annual
          - agriculture_value_added_percent_gdp
          - industry_value_added_percent_gdp
          - services_value_added_percent_gdp
          - exports_of_goods_services_percent_gdp
          - imports_of_goods_services_percent_gdp
          - gross_capital_formation_percent_gdp
          - net_migration
          - gni_usd
          - gni_per_capita_usd
          - gni_ppp_usd
          - gni_per_capita_ppp_usd
          - income_share_lowest_twenty
          - life_expectancy
          - fertility_rate
          - prevalence_hiv_total
          - co2_emissions_tons_per_capita
          - surface_area_km
          - poverty_poverty_lines_percent_population
          - revenue_excluding_grants_percent_gdp
          - cash_surplus_deficit_percent_gdp
          - startup_procedures_register
          - market_cap_domestic_companies_percent_gdp
          - mobile_subscriptions_per_hundred
          - internet_users_per_hundred
          - high_technology_exports_percent_total
          - merchandise_trade_percent_gdp
          - total_debt_service_percent_gni
          - unemployment_total_percent
          default: gdp_current_usd
      - name: fmt
        in: query
        required: false
        description: 'Output format: ''json'' or ''csv''. Default is ''json''.'
        schema:
          type: string
          enum:
          - json
          - csv
          default: json
      responses:
        '200':
          description: Successfully retrieved macroeconomic data.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    CountryCode:
                      type: string
                      description: ISO Alpha-3 country code, e.g., 'USA' for United States.
                    CountryName:
                      type: string
                      description: Country name, e.g., 'United States'.
                    Indicator:
                      type: string
                      description: Indicator name, e.g., 'Inflation, consumer prices (annual %)'.
                    Date:
                      type: string
                      format: date
                      description: Date of the recorded value.
                    Period:
                      type: string
                      description: Period of the data, e.g., 'Annual'.
                    Value:
                      type: number
                      description: Recorded value of the indicator.
              example:
              - CountryCode: USA
                CountryName: United States
                Indicator: Inflation, consumer prices (annual %)
                Date: '2023-12-31'
                Period: Annual
                Value: 4.1163
              - CountryCode: USA
                CountryName: United States
                Indicator: Inflation, consumer prices (annual %)
                Date: '2022-12-31'
                Period: Annual
                Value: 8.0028
        '400':
          description: Invalid request parameters.
        '401':
          description: Unauthorized. Invalid API token.
        '404':
          description: Data not found for the specified country or indicator.
      tags:
      - Economic Data
components:
  securitySchemes:
    EODHDQueryKey:
      type: apiKey
      in: query
      name: api_token
      description: EODHD API key (stored as a secret in ChatGPT).