### Example API Request for Currency Change Source: https://energypriceapi.com/documentation This snippet shows a typical GET request to the /v1/change endpoint. It includes required parameters like api_key, start_date, and end_date, along with optional parameters for base currency and specific currencies. ```http https://api.energypriceapi.com/v1/change ?api_key=[API_KEY] &start_date=2022-12-22 &end_date=2022-12-24 &base=USD ¤cies=BRENT ``` -------------------------------- ### Example API Request for Symbols Source: https://energypriceapi.com/documentation This is an example of an API request to retrieve a list of supported currency symbols. Ensure you replace `[API_KEY]` with your actual API key. ```http https://api.energypriceapi.com/v1/symbols ?api_key=[API_KEY] ``` -------------------------------- ### API Usage Response Example Source: https://energypriceapi.com/documentation An example of a successful response from the usage endpoint, detailing the current plan, requests used, total quota, and remaining quota. ```json { "success": true, "result": { "plan": "Business", "used": 12, "total": 100, "remaining": 88 } } ``` -------------------------------- ### Example API Response for Currency Change Source: https://energypriceapi.com/documentation This snippet illustrates the JSON structure returned by the /v1/change endpoint upon a successful request. It includes the base currency, date range, and detailed rates for requested currencies, showing start rate, end rate, and calculated changes. ```json { "success": true, "base": "USD", "start_date": "2022-12-22", "end_date": "2022-12-24", "rates": { "BRENT": { "start_rate": 0.01217137, "end_rate": 0.01191611, "change": -0.00025526, "change_pct": -2.0972 } } } ``` -------------------------------- ### Example API Error Response Source: https://energypriceapi.com/documentation This is an example of an error response from the API. It indicates a failure and provides a specific error code and informational message. ```json { "success": false, "error": { "code": 104, "info": "Your monthly usage limit has been reached. Please upgrade your subscription plan." } } ``` -------------------------------- ### Example API Response for Symbols Source: https://energypriceapi.com/documentation This is an example of a successful API response when requesting supported currency symbols. The 'symbols' object contains currency codes as keys and their descriptions as values. ```json { "success": true, "symbols": { "AED": "UAE Dirham", "AFN": "Afghan Afghani", "ALL": "Albanian Lek", ... } } ``` -------------------------------- ### Hourly Rates API Response Example Source: https://energypriceapi.com/documentation This is an example of a successful API response for hourly exchange rates. It includes the success status, base currency, date range, and a list of rates for each hour, including the timestamp and the exchange rate for the specified currency. ```json { "success": true, "base": "USD", "start_date": "2025-11-03", "end_date": "2025-11-03", "rates": [ { "timestamp": 1762128000, "rates": { "BRENT": 0.01194215 } }, { "timestamp": 1762131600, "rates": { "BRENT": 0.01196832 } }, ... ] } ``` -------------------------------- ### OHLC API Response Example Source: https://energypriceapi.com/documentation This is an example of a successful response when requesting OHLC data. It includes the base and quote currencies, a timestamp, and the OHLC rate details. ```json { "success": true, "base": "USD", "quote": "WTI", "timestamp": 1738108799, "rate": { "close": 0.01269938, "high": 0.01285012, "low": 0.01255318, "open": 0.01271186 } } ``` -------------------------------- ### Authenticate API Key via Query Parameter Source: https://energypriceapi.com/documentation Example of how to pass your API key as a query parameter in the request URL. ```URL https://api.energypriceapi.com/v1/latest?api_key=API_KEY ``` -------------------------------- ### Authenticate API Key via Request Header Source: https://energypriceapi.com/documentation Example of how to pass your API key using the 'X-API-KEY' request header. Ensure 'Content-Type' is set to 'application/json'. ```bash curl https://api.energypriceapi.com/v1/latest \ -H 'X-API-KEY: YOUR_API_KEY' \ -H 'Content-Type: application/json' ``` -------------------------------- ### API Endpoints Overview Source: https://energypriceapi.com/documentation A list of available API endpoints and their basic usage examples. Each endpoint serves a specific data retrieval purpose. ```URL // "symbols" - get list of all supported currencies https://api.energypriceapi.com/v1/symbols ``` ```URL // "latest" - get real-time exchange rate data for all available/specific currencies https://api.energypriceapi.com/v1/latest ``` ```URL // "historical" - get historical rates for a specific day https://api.energypriceapi.com/v1/YYYY-MM-DD ``` ```URL // "hourly" - get hourly exchange rate data for a currency over a date range https://api.energypriceapi.com/v1/hourly?currency=BRENT&start_date=2025-11-03&end_date=2025-11-03 ``` ```URL // "ohlc" - get open, high, low, and close prices for a currency pair https://api.energypriceapi.com/v1/ohlc?base=USD¤cy=WTI&date=2025-01-28 ``` ```URL // "convert" - convert one currency to another based on real-time or historic exchange rate data https://api.energypriceapi.com/v1/convert?from=USD&to=WTI&amount=100 ``` ```URL // "timeframe" - request exchange rates for a specific period of time https://api.energypriceapi.com/v1/timeframe?start_date=2021-01-01&end_date=2021-05-01 ``` ```URL // "change" - request any currency change parameters (margin, percentage) https://api.energypriceapi.com/v1/change?base=USD&start_date=2021-01-01&end_date=2021-05-01 ``` ```URL // "usage" - check your API usage and quota for the current month https://api.energypriceapi.com/v1/usage ``` -------------------------------- ### Get Supported Symbols Source: https://energypriceapi.com/documentation Retrieves a list of all supported currency symbols available through the API. ```APIDOC ## GET /v1/symbols ### Description Retrieves a list of all supported currency symbols. ### Method GET ### Endpoint /v1/symbols ### Parameters None ### Request Example None ### Response #### Success Response (200) - **symbols** (object) - An object containing all supported currency symbols and their details. ``` -------------------------------- ### Get Latest Rates Source: https://energypriceapi.com/documentation Fetches real-time exchange rate data for specified or all available currencies. ```APIDOC ## GET /v1/latest ### Description Fetches real-time exchange rate data for all available or specific currencies. ### Method GET ### Endpoint /v1/latest ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **base** (string) - Optional - The base currency for the exchange rate. - **symbols** (string) - Optional - A comma-separated list of currency symbols to retrieve rates for. ``` -------------------------------- ### Get Open/High/Low/Close Prices Source: https://energypriceapi.com/documentation Retrieves the open, high, low, and close prices for a currency pair on a specific date. ```APIDOC ## GET /v1/ohlc ### Description Retrieves open, high, low, and close prices for a currency pair. ### Method GET ### Endpoint /v1/ohlc ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **base** (string) - Required - The base currency symbol. - **currency** (string) - Required - The quote currency symbol. - **date** (string) - Required - The date for which to retrieve OHLC data (YYYY-MM-DD). ``` -------------------------------- ### Live Energy Rates API Response Source: https://energypriceapi.com/documentation Example JSON response for live energy rates, showing success status, base currency, timestamp, and exchange rates. ```json { "success": true, "base": "USD", "timestamp": 1672289920, "rates": { "BRENT": 0.01194215, "GASOLINE": 0.42227946, "NATURALGAS": 0.21235931 "WTI": 0.01269938 } } ``` -------------------------------- ### Get Hourly Rates Source: https://energypriceapi.com/documentation Fetches hourly exchange rate data for a currency over a specified date range. ```APIDOC ## GET /v1/hourly ### Description Fetches hourly exchange rate data for a currency over a date range. ### Method GET ### Endpoint /v1/hourly ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **currency** (string) - Required - The currency symbol for which to retrieve hourly rates. - **start_date** (string) - Required - The start date for the hourly data (YYYY-MM-DD). - **end_date** (string) - Required - The end date for the hourly data (YYYY-MM-DD). ``` -------------------------------- ### Get Live Energy Rates Source: https://energypriceapi.com/documentation Retrieve real-time exchange rates for energy commodities. Specify base currency and desired currencies. Defaults to USD base if not specified. ```http https://api.energypriceapi.com/v1/latest ?api_key=[API_KEY] &base=USD ¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` ```http https://api.energypriceapi.com/v1/latest ?api_key=[API_KEY] &base=USD ¤cies=BRENT,GASOLINE,NATURALGAS,WTI &math=multiply(value,1.005) ``` -------------------------------- ### Get Latest Exchange Rates Source: https://energypriceapi.com/documentation Basic URL to fetch the latest exchange rates. Replace [API_KEY] with your actual API key. ```URL https://api.energypriceapi.com/v1/latest?api_key=[API_KEY] ``` -------------------------------- ### Get Historical Rates Source: https://energypriceapi.com/documentation Retrieves historical exchange rate data for a specific day. ```APIDOC ## GET /v1/{YYYY-MM-DD} ### Description Retrieves historical rates for a specific day. ### Method GET ### Endpoint /v1/YYYY-MM-DD ### Parameters #### Path Parameters - **YYYY-MM-DD** (string) - Required - The date for which to retrieve historical rates (e.g., 2023-10-27). #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **base** (string) - Optional - The base currency for the exchange rate. - **symbols** (string) - Optional - A comma-separated list of currency symbols to retrieve rates for. ``` -------------------------------- ### Get Timeframe Data Source: https://energypriceapi.com/documentation Requests exchange rates for a specific period of time. ```APIDOC ## GET /v1/timeframe ### Description Requests exchange rates for a specific period of time. ### Method GET ### Endpoint /v1/timeframe ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **start_date** (string) - Required - The start date for the timeframe (YYYY-MM-DD). - **end_date** (string) - Required - The end date for the timeframe (YYYY-MM-DD). - **base** (string) - Optional - The base currency symbol. - **symbols** (string) - Optional - A comma-separated list of currency symbols. ``` -------------------------------- ### Get Change Data Source: https://energypriceapi.com/documentation Requests any currency change parameters, such as margin or percentage, over a specified date range. ```APIDOC ## GET /v1/change ### Description Requests any currency change parameters (margin, percentage) over a date range. ### Method GET ### Endpoint /v1/change ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **base** (string) - Required - The base currency symbol. - **start_date** (string) - Required - The start date for the change data (YYYY-MM-DD). - **end_date** (string) - Required - The end date for the change data (YYYY-MM-DD). - **change_type** (string) - Optional - The type of change to retrieve (e.g., 'margin', 'percentage'). ``` -------------------------------- ### Get Yesterday's Energy Rates Source: https://energypriceapi.com/documentation Retrieve yesterday's historical exchange rates. Defaults to USD base if not specified. ```http https://api.energypriceapi.com/v1/yesterday ?api_key=[API_KEY] &base=USD ¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` -------------------------------- ### Hourly Rates API Request (Date Form) Source: https://energypriceapi.com/documentation Use this format to request hourly exchange rates by specifying start and end dates. Ensure only one currency is requested per query. Free users are limited to 2 days, while paid users can query up to 7 days. ```api https://api.energypriceapi.com/v1/hourly ?api_key=[API_KEY] &base=USD ¤cy=BRENT &start_date=2025-11-03 &end_date=2025-11-03 ``` -------------------------------- ### Hourly Rates API Request (Timestamp Form) Source: https://energypriceapi.com/documentation Use this format to request hourly exchange rates by specifying start and end UNIX timestamps. This method is an alternative to using date strings. Ensure only one currency is requested per query. ```api https://api.energypriceapi.com/v1/hourly ?api_key=[API_KEY] &base=USD ¤cy=BRENT &start=1762128000 &end=1762146000 ``` -------------------------------- ### Get OHLC Data for a Currency Pair Source: https://energypriceapi.com/documentation Retrieve Open, High, Low, and Close prices for a specified currency pair and date. Ensure to include your API key and the required base, currency, and date parameters. ```http https://api.energypriceapi.com/v1/ohlc ?api_key=[API_KEY] &base=USD ¤cy=WTI &date=2025-01-28 ``` -------------------------------- ### Historical Energy Rates API Response Source: https://energypriceapi.com/documentation Example JSON response for historical energy rates, showing success status, base currency, timestamp, and exchange rates. ```json { "success": true, "base": "USD", "timestamp": 1616558399, "rates": { "BRENT": 0.01191611, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 } } ``` -------------------------------- ### Get Historical Energy Rates by Date Source: https://energypriceapi.com/documentation Retrieve historical exchange rates for a specific date. Use YYYY-MM-DD format for the date. Defaults to USD base if not specified. ```http https://api.energypriceapi.com/v1/2022-12-24 ?api_key=[API_KEY] &base=USD ¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` -------------------------------- ### Live Rates Source: https://energypriceapi.com/documentation Retrieves real-time (delayed) energy commodity exchange rates based on your subscription plan. ```APIDOC ## GET /v1/latest ### Description This endpoint will return real-time exchange rate data (delayed) depending on your subscription plan. ### Method GET ### Endpoint https://api.energypriceapi.com/v1/latest ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **base** (string) - Optional - Specify a base currency. Defaults to USD. - **currencies** (string) - Optional - Specify a comma-separated list of currency codes to limit API responses to specified currencies. If not defined, all supported currencies are returned. - **math** (string) - Optional - Specify math operators to perform on the result. Use **value** to refer to the rates. Specify one or more of the mathematical operators **add**, **subtract**, **multiply**, and/or **divide**. ### Request Example ```json https://api.energypriceapi.com/v1/latest?api_key=[API_KEY]&base=USD¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` ```json https://api.energypriceapi.com/v1/latest?api_key=[API_KEY]&base=USD¤cies=BRENT,GASOLINE,NATURALGAS,WTI&math=multiply(value,1.005) ``` ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **timestamp** (integer) - Returns the UNIX timestamp the given exchange rates were collected. - **rates** (object) - Returns exchange rate data for the currencies requested. #### Response Example ```json { "success": true, "base": "USD", "timestamp": 1672289920, "rates": { "BRENT": 0.01194215, "GASOLINE": 0.42227946, "NATURALGAS": 0.21235931, "WTI": 0.01269938 } } ``` ``` -------------------------------- ### Change Query Source: https://energypriceapi.com/documentation Requests the percentage change of specified currencies against a base currency within a given date range or predefined timeframe. ```APIDOC ## GET /v1/change ### Description This endpoint is used to request the change (percentage) of one or more currencies, relative to a `base` currency with a specific time-frame (optional). The API will return `change` values of the specified `start_date` and `end_date`. ### Method GET ### Endpoint /v1/change ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **start_date** (string) - Required - Specify the start date of your timeframe. - **end_date** (string) - Required - Specify the end date of your timeframe. - **base** (string) - Optional - Specify a base currency. Base Currency will default to USD if this parameter is not defined. - **currencies** (string) - Optional - Specify a comma-separated list of currency codes to limit API responses to specified currencies. If this parameter is not defined, the API will return all supported currencies. - **date_type** (string) - Optional - Specify "recent", "yesterday", "week", "month", or "year" to retrieve the rate change for the corresponding time period. If provided, this parameter overrides "start_date" and "end_date". * **recent**: Calculates change from yesterday's closing rate to the current rate. * **yesterday**: Calculates change from start of yesterday to end of yesterday. * **week**: Calculates change over the last 7 days. * **month**: Calculates change over the last month. * **year**: Calculates change over the last year. ### Request Example ``` https://api.energypriceapi.com/v1/change?api_key=[API_KEY]&start_date=2022-12-22&end_date=2022-12-24&base=USD¤cies=BRENT ``` ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **start_date** (string) - Returns start date of your timeframe for the request. - **end_date** (string) - Returns end date of your timeframe for the request. - **rates** (object) - Contains currency rate information. - **rates -> start_rate** (number) - Returns exchange rate for the start date. - **rates -> end_rate** (number) - Returns exchange rate for the end date. - **rates -> change** (number) - Returns change (decimal number) of the given currency rate between the start and end date. - **rates -> change_pct** (number) - Returns percent change of the given currency rate between your start and end date. #### Response Example ```json { "success": true, "base": "USD", "start_date": "2022-12-22", "end_date": "2022-12-24", "rates": { "BRENT": { "start_rate": 0.01217137, "end_rate": 0.01191611, "change": -0.00025526, "change_pct": -2.0972 } } } ``` ``` -------------------------------- ### Open/High/Low/Close (OHLC) Data Source: https://energypriceapi.com/documentation Retrieves open, high, low, and close prices for a given currency pair for a specific date or time period. ```APIDOC ## GET /v1/ohlc ### Description This endpoint will return open, high, low, and close prices for a given currency pair. OHLC data uses a 00:00 to 23:59:59 GMT trading day. The open price is captured at midnight GMT (00:00), and the close price is captured at 23:59:59 GMT. The previous day's OHLC data becomes available at 00:05 AM GMT. ### Method GET ### Endpoint /v1/ohlc ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **base** (string) - Optional - Specify a base currency. Defaults to USD. - **currency** (string) - Required - Specify a currency. - **date** (string) - Required - Specify a date in the format `YYYY-MM-DD` to get the OHLC for the specified date. - **date_type** (string) - Optional - (Paid plan) Specify "yesterday", "week", "month", or "year" to retrieve the rate change for the corresponding time period. If provided, this parameter overrides "date". ### Request Example { "example": "https://api.energypriceapi.com/v1/ohlc?api_key=[API_KEY]&base=USD¤cy=WTI&date=2025-01-28" } ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **quote** (string) - Returns quote currency used for the request. - **timestamp** (integer) - Returns the UNIX timestamp for the OHLC data. - **rate** (object) - Contains OHLC prices. - **close** (number) - Returns close price for the specified date. - **high** (number) - Returns high price for the specified date. - **low** (number) - Returns low price for the specified date. - **open** (number) - Returns open price for the specified date. #### Response Example { "success": true, "base": "USD", "quote": "WTI", "timestamp": 1738108799, "rate": { "close": 0.01269938, "high": 0.01285012, "low": 0.01255318, "open": 0.01271186 } } ``` -------------------------------- ### Check API Usage and Quota Source: https://energypriceapi.com/documentation This endpoint allows you to check your current API usage and monthly quota. Requests to this endpoint do not count against your quota. Include your API key in the request. ```http https://api.energypriceapi.com/v1/usage ?api_key=[API_KEY] ``` -------------------------------- ### Hourly Rates Source: https://energypriceapi.com/documentation Retrieves hourly exchange rate data for a given currency over a specified date range. Supports date or timestamp queries and has different limits for free and paid users. ```APIDOC ## GET /v1/hourly ### Description This endpoint returns hourly exchange rate data for a given currency over a specified date range. It provides 24 data points per day, one for each hour. Only one currency is allowed per request. Free users can query up to 2 days; paid users can query up to 7 days. Future dates are not allowed. ### Method GET ### Endpoint /v1/hourly ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **base** (string) - Optional - Specify a base currency. Defaults to USD. - **currency** (string) - Required - Specify a single currency code. Only one currency is allowed per request. - **start_date** (string) - Optional - Specify the start date in `YYYY-MM-DD` format. Defaults to today. Cannot be combined with `start`/`end`. - **end_date** (string) - Optional - Specify the end date in `YYYY-MM-DD` format. Defaults to today. Cannot be combined with `start`/`end`. - **start** (integer) - Optional - Specify the start as a UNIX timestamp (seconds since epoch). Cannot be combined with `start_date`/`end_date`. - **end** (integer) - Optional - Specify the end as a UNIX timestamp (seconds since epoch). Defaults to the current hour. Cannot be combined with `start_date`/`end_date`. - **date_type** (string) - Optional - (Paid plan) Specify "today", "yesterday", or "week" as a shortcut. If provided, this parameter overrides "start_date" and "end_date". - **math** (string) - Optional - (Paid plan) Specify math operators to perform on the result. Use **value** to refer to the rates. Specify one or more of the mathematical operators **add**, **subtract**, **multiply**, and/or **divide**. ### Request Example ``` https://api.energypriceapi.com/v1/hourly?api_key=[API_KEY]&base=USD¤cy=BRENT&start_date=2025-11-03&end_date=2025-11-03 ``` ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **start_date** (string) - Returns start date of the hourly query. - **end_date** (string) - Returns end date of the hourly query. - **rates** (array) - Array of hourly data points. - **timestamp** (integer) - Returns the UNIX timestamp for the hourly data point. - **rates** (object) - Exchange rate data for the requested currency. - **[currency_code]** (number) - The exchange rate for the specified currency. #### Response Example ```json { "success": true, "base": "USD", "start_date": "2025-11-03", "end_date": "2025-11-03", "rates": [ { "timestamp": 1762128000, "rates": { "BRENT": 0.01194215 } }, { "timestamp": 1762131600, "rates": { "BRENT": 0.01196832 } } ] } ``` ``` -------------------------------- ### Convert Currency Source: https://energypriceapi.com/documentation Converts an amount from one currency to another using real-time or historical exchange rates. ```APIDOC ## GET /v1/convert ### Description Converts one currency to another based on real-time or historic exchange rate data. ### Method GET ### Endpoint /v1/convert ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. - **from** (string) - Required - The currency symbol to convert from. - **to** (string) - Required - The currency symbol to convert to. - **amount** (number) - Required - The amount of currency to convert. ``` -------------------------------- ### Check API Usage Source: https://energypriceapi.com/documentation Allows users to check their API usage and quota for the current month. ```APIDOC ## GET /v1/usage ### Description Checks your API usage and quota for the current month. ### Method GET ### Endpoint /v1/usage ### Parameters #### Query Parameters - **api_key** (string) - Required - Your unique API key for authentication. ``` -------------------------------- ### Timeframe Query Source: https://energypriceapi.com/documentation Retrieves historical exchange rates for a specified time period (maximum range of 365 days). ```APIDOC ## GET /v1/timeframe ### Description This endpoint is used to get historical rates for a specified time period (max range: 365 days). ### Method GET ### Endpoint https://api.energypriceapi.com/v1/timeframe ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **start_date** (string) - Required - Specify the start date of your timeframe. - **end_date** (string) - Required - Specify the end date of your timeframe. - **base** (string) - Optional - Specify a base currency. Base Currency will default to USD if this parameter is not defined. - **currencies** (string) - Optional - Specify a comma-separated list of currency codes to limit API responses to specified currencies. If this parameter is not defined, the API will return all supported currencies. ### Request Example { "example": "https://api.energypriceapi.com/v1/timeframe?api_key=[API_KEY]&start_date=2022-12-23&end_date=2022-12-24&base=USD¤cies=BRENT,GASOLINE,NATURALGAS,WTI" } ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **start_date** (string) - Returns start date of your timeframe for the request. - **end_date** (string) - Returns end date of your timeframe for the request. - **rates** (object) - Returns exchange rate data for the currencies requested. #### Response Example { "success": true, "base": "USD", "start_date": "2022-12-23", "end_date": "2022-12-24", "rates": { "2022-12-23": { "BRENT": 0.01187747, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 }, "2022-12-24": { "BRENT": 0.01191611, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 } } } ``` -------------------------------- ### Symbols Endpoint Source: https://energypriceapi.com/documentation Retrieves a list of supported currency symbols and their descriptions. This request does not count towards your monthly API quota. ```APIDOC ## GET /v1/symbols ### Description This endpoint is used to get the list of the most up-to-date supported symbols. Requests to this endpoint do not count towards your monthly API quota. ### Method GET ### Endpoint /v1/symbols ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. More details. ### Request Example ``` https://api.energypriceapi.com/v1/symbols?api_key=[API_KEY] ``` ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. If false, refer to API Errors. - **symbols** (object) - Key is supported currency, value is description of currency. #### Response Example ```json { "success": true, "symbols": { "AED": "UAE Dirham", "AFN": "Afghan Afghani", "ALL": "Albanian Lek", ... } } ``` ``` -------------------------------- ### Currency Convert Source: https://energypriceapi.com/documentation Converts a specified amount from one currency to another. It can use live rates or historical rates based on a provided date. ```APIDOC ## GET /v1/convert ### Description This endpoint is used to convert any amount from one currency to another. It can use live rates or historical rates based on a provided date. ### Method GET ### Endpoint https://api.energypriceapi.com/v1/convert ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. - **from** (string) - Optional - Specify currency you would like to convert from. Base Currency will default to USD if this parameter is not defined. - **to** (string) - Required - Specify currency you would like to convert to. - **amount** (number) - Required - The amount to convert. - **date** (string) - Optional - Specify date to use historical midpoint value for conversion. Otherwise, it will use live exchange rate date with delay specified based on your subscription plan. ### Request Example { "example": "https://api.energypriceapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=WTI&amount=100&date=2022-12-24" } ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **query -> from** (string) - Returns currency converted from used for the request. - **query -> to** (string) - Returns currency converted to used for the request. - **query -> amount** (number) - Returns amount to convert. - **info -> quote** (number) - Returns the exchange rate used for the conversion. - **info -> timestamp** (integer) - Returns the UNIX timestamp the given exchange rates were collected. - **result** (number) - Returns conversion result. #### Response Example { "success": true, "query": { "from": "USD", "to": "WTI", "amount": 100 }, "info": { "quote": 0.01259652, "timestamp": 1671839999 }, "result": 1.25965208 } ``` -------------------------------- ### Currency Conversion API Response Source: https://energypriceapi.com/documentation The response includes success status, query details, conversion information, and the final conversion result. ```json { "success": true, "query": { "from": "USD", "to": "WTI", "amount": 100 }, "info": { "quote": 0.01259652, "timestamp": 1671839999 }, "result": 1.25965208 } ``` -------------------------------- ### Convert Currency API Request Source: https://energypriceapi.com/documentation Use this endpoint to convert an amount from one currency to another. Specify the source and target currencies, amount, and optionally a date for historical rates. ```http https://api.energypriceapi.com/v1/convert ?api_key=[API_KEY] &from=USD &to=WTI &amount=100 &date=2022-12-24 ``` -------------------------------- ### Historical Rates Source: https://energypriceapi.com/documentation Retrieves historical exchange rate data for a specified date. The previous day's rates are available daily after 00:05 AM GMT. ```APIDOC ## GET /v1/{date} ### Description This endpoint will return historical exchange rate data. The previous day's historical rates become available each day at 00:05 AM GMT. Use format `YYYY-MM-DD` or `yesterday` for the date. ### Method GET ### Endpoint https://api.energypriceapi.com/v1/{date} ### Parameters #### Path Parameters - **date** (string) - Required - The date for historical rates. Use `YYYY-MM-DD` or `yesterday` format. #### Query Parameters - **api_key** (string) - Required - Your API Key. - **base** (string) - Optional - Specify a base currency. Defaults to USD. - **currencies** (string) - Optional - Specify a comma-separated list of currency codes to limit API responses to specified currencies. If not defined, all supported currencies are returned. ### Request Example ```json https://api.energypriceapi.com/v1/2022-12-24?api_key=[API_KEY]&base=USD¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` ```json https://api.energypriceapi.com/v1/yesterday?api_key=[API_KEY]&base=USD¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **base** (string) - Returns base currency used for the request. - **timestamp** (integer) - Returns the UNIX timestamp the given exchange rates were collected. - **rates** (object) - Returns exchange rate data for the currencies requested. #### Response Example ```json { "success": true, "base": "USD", "timestamp": 1616558399, "rates": { "BRENT": 0.01191611, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 } } ``` ``` -------------------------------- ### Timeframe Query API Response Source: https://energypriceapi.com/documentation The response contains the success status, request parameters, and a 'rates' object with historical exchange rates for the specified period and currencies. ```json { "success": true, "base": "USD", "start_date": "2022-12-23", "end_date": "2022-12-24", "rates": { "2022-12-23": { "BRENT": 0.01187747, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 }, "2022-12-24": { "BRENT": 0.01191611, "GASOLINE": 0.41813012, "NATURALGAS": 0.19884669, "WTI": 0.01259652 } } } ``` -------------------------------- ### API Usage Source: https://energypriceapi.com/documentation This endpoint is used to check your API usage and quota for the current month. Requests to this endpoint do not count towards your monthly API quota. ```APIDOC ## GET /v1/usage ### Description This endpoint is used to check your API usage and quota for the current month. Requests to this endpoint do not count towards your monthly API quota. ### Method GET ### Endpoint /v1/usage ### Parameters #### Query Parameters - **api_key** (string) - Required - Your API Key. ### Request Example { "example": "https://api.energypriceapi.com/v1/usage?api_key=[API_KEY]" } ### Response #### Success Response (200) - **success** (boolean) - Returns true or false depending if the API Request succeeded. - **result** (object) - Contains usage details. - **plan** (string) - Returns your current plan. - **used** (integer) - Returns the number of requests used for the current month. - **total** (integer) - Returns your total quota for the current month. - **remaining** (integer) - Returns your remaining quota for the current month. #### Response Example { "success": true, "result": { "plan": "Business", "used": 12, "total": 100, "remaining": 88 } } ``` -------------------------------- ### Timeframe Query API Request Source: https://energypriceapi.com/documentation Retrieve historical exchange rates for a specified date range (up to 365 days). You can specify base currency and a list of target currencies. ```http https://api.energypriceapi.com/v1/timeframe ?api_key=[API_KEY] &start_date=2022-12-23 &end_date=2022-12-24 &base=USD ¤cies=BRENT,GASOLINE,NATURALGAS,WTI ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.