{"id":7868,"date":"2026-04-07T16:31:46","date_gmt":"2026-04-07T14:31:46","guid":{"rendered":"https:\/\/eodhd.com\/financial-apis\/?p=7868"},"modified":"2026-04-07T17:28:05","modified_gmt":"2026-04-07T15:28:05","slug":"commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","status":"publish","type":"post","link":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","title":{"rendered":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)"},"content":{"rendered":"\n<p>The EODHD Commodities API provides historical price data for 23 commodity series sourced from the Federal Reserve Economic Data (FRED). It covers energy, metals, and agricultural commodities with daily, weekly, monthly, quarterly, and annual intervals \u2014 going back decades for most series.<\/p>\n\n\n\n<p>All code examples use Python. You will need an EODHD API subscription that includes access to the Commodities endpoint.<\/p>\n\n\n\n\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-known-limitations\">Known Limitations<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Precious metals removed:<\/strong> Gold (LBMA), Silver, Platinum, and Palladium series have been discontinued by FRED due to LBMA licensing changes. <\/li>\n\n\n\n<li><strong>Monthly lag:<\/strong> Monthly series (metals, agricultural) typically have a 1-2 month reporting delay from FRED.<\/li>\n\n\n\n<li><strong>Interval availability:<\/strong> Not all commodities support all intervals. Daily data is only available for energy commodities. Metals and agricultural commodities are typically monthly only.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-api-endpoint\">API Endpoint<\/h2>\n\n\n\n\n    <div class=\"api_url_box\" data-feed=\"EOD Historical Data\">\n                    <div class=\"tabs\">\n                                    <div class=\"selected\">URL<\/div>\n                                    <div class=\"\">cURL<\/div>\n                                    <div class=\"\">PHP<\/div>\n                                    <div class=\"\">Python<\/div>\n                                    <div class=\"\">R<\/div>\n                                <div>Chat GPT<\/div>\n            <\/div>\n                <div class=\"tab_content\">\n                                            <div class=\"item selected\">\n                    <div class=\"buttons\">\n                                                    <button\n                                class=\"view\"\n                                title=\"View request in new tab\"\n                                onclick=\"gtag('event', 'ViewApiRequest', {'event_category':'TrialApiData'});\"\n                            >\n                                <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                    <use xlink:href=\"\/img\/icons\/openLink.svg#openLink\"><\/use>\n                                <\/svg>\n                            <\/button>\n                                                <button\n                            onclick=\"gtag('event', 'CopyApiUrl', {'event_category':'TrialApiData'});\"\n                            class=\"copy\"\n                            title=\"Copy url\"\n                        >\n                            <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                            <\/svg>\n                        <\/button>\n                    <\/div>\n                    <pre class=\"api_url_text bold\">https:\/\/eodhd.com\/api\/commodities\/historical\/{CODE}?api_token=<span class='orange bold api_token'>YOUR_TOKEN<\/span><\/pre>\n                    <div class=\"register_link\">\n                        (<a href=\"\/register\">Sign up<\/a> for free to get an API token)\n                    <\/div>\n                <\/div>\n                                            <div class=\"item \">\n                    <div class=\"buttons\">\n                                                <button\n                            onclick=\"gtag('event', 'CopyApiUrl', {'event_category':'TrialApiData'});\"\n                            class=\"copy\"\n                            title=\"Copy url\"\n                        >\n                            <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                            <\/svg>\n                        <\/button>\n                    <\/div>\n                    <pre class=\"api_url_text bold\">curl --location \"https:\/\/eodhd.com\/api\/commodities\/historical\/{CODE}?api_token=<span class='orange bold api_token'>YOUR_TOKEN<\/span>&fmt=json\"<\/pre>\n                    <div class=\"register_link\">\n                        (<a href=\"\/register\">Sign up<\/a> for free to get an API token)\n                    <\/div>\n                <\/div>\n                                            <div class=\"item \">\n                    <div class=\"buttons\">\n                                                <button\n                            onclick=\"gtag('event', 'CopyApiUrl', {'event_category':'TrialApiData'});\"\n                            class=\"copy\"\n                            title=\"Copy url\"\n                        >\n                            <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                            <\/svg>\n                        <\/button>\n                    <\/div>\n                    <pre class=\"api_url_text bold\">\n$curl = curl_init();\n\ncurl_setopt_array($curl, array(\n    CURLOPT_URL => 'https:\/\/eodhd.com\/api\/commodities\/historical\/{CODE}?api_token=<span class='orange bold api_token'>YOUR_TOKEN<\/span>&fmt=json',\n    CURLOPT_RETURNTRANSFER => true,\n    CURLOPT_ENCODING => '',\n    CURLOPT_MAXREDIRS => 10,\n    CURLOPT_TIMEOUT => 0,\n    CURLOPT_FOLLOWLOCATION => true,\n    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n    CURLOPT_CUSTOMREQUEST => 'GET',\n));\n\n$data = curl_exec($curl);\ncurl_close($curl);\n\ntry {\n    $data = json_decode($data, true, 512, JSON_THROW_ON_ERROR);\n    var_dump($data);\n} catch (Exception $e) {\n    echo 'Error. '.$e->getMessage();\n}<\/pre>\n                    <div class=\"register_link\">\n                        (<a href=\"\/register\">Sign up<\/a> for free to get an API token)\n                    <\/div>\n                <\/div>\n                                            <div class=\"item \">\n                    <div class=\"buttons\">\n                                                <button\n                            onclick=\"gtag('event', 'CopyApiUrl', {'event_category':'TrialApiData'});\"\n                            class=\"copy\"\n                            title=\"Copy url\"\n                        >\n                            <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                            <\/svg>\n                        <\/button>\n                    <\/div>\n                    <pre class=\"api_url_text bold\">\nimport requests\n\nurl = f'https:\/\/eodhd.com\/api\/commodities\/historical\/{CODE}?api_token=<span class='orange bold api_token'>YOUR_TOKEN<\/span>&fmt=json'\ndata = requests.get(url).json()\n\nprint(data)<\/pre>\n                    <div class=\"register_link\">\n                        (<a href=\"\/register\">Sign up<\/a> for free to get an API token)\n                    <\/div>\n                <\/div>\n                                            <div class=\"item \">\n                    <div class=\"buttons\">\n                                                <button\n                            onclick=\"gtag('event', 'CopyApiUrl', {'event_category':'TrialApiData'});\"\n                            class=\"copy\"\n                            title=\"Copy url\"\n                        >\n                            <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                                <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                            <\/svg>\n                        <\/button>\n                    <\/div>\n                    <pre class=\"api_url_text bold\">\nlibrary(httr)\nlibrary(jsonlite)\n\nurl <- 'https:\/\/eodhd.com\/api\/commodities\/historical\/{CODE}?api_token=<span class='orange bold api_token'>YOUR_TOKEN<\/span>&fmt=json'\nresponse <- GET(url)\n\nif (http_type(response) == \"application\/json\") {\n    content <- content(response, \"text\", encoding = \"UTF-8\")\n    cat(content)\n} else {\n    cat(\"Error while receiving data\\n\")\n}<\/pre>\n                    <div class=\"register_link\">\n                        (<a href=\"\/register\">Sign up<\/a> for free to get an API token)\n                    <\/div>\n                <\/div>\n                        <div class=\"item replace-deny\">\n                <div class=\"buttons\">\n                    <a\n                        class=\"view\"\n                        title=\"View request in new tab\"\n                        href=\"\/lp\/eodhd-chatgpt\"\n                        target=\"_blank\"\n                    >\n                        <svg class=\"tryFreeBtn__svg\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/openLink.svg#openLink\"><\/use>\n                        <\/svg>\n                    <\/a>\n                <\/div>\n                <div class=\"api_url_text bold\" style=\"word-break: normal;white-space: normal;\">\n                    New to coding? Our ChatGPT assistant can generate code in any language tailored to our API.\n                    Simply describe how you want to use our data, and get a working piece of code.\n                    Don\u2019t forget to replace the API token with your own.<br><br>\n                    <a href=\"\/lp\/eodhd-chatgpt\" target=\"_blank\">Try it now (it's free)!<\/a><br><br>\n                    <a href=\"https:\/\/www.youtube.com\/watch?v=QVWiLukag7o\" rel=\"nofollow\" target=\"_blank\">\n                        How to use it (YouTube)\n                    <\/a>\n                <\/div>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    \n\n\n\n<p><strong>Parameters:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Required<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>CODE<\/td><td>Yes<\/td><td>Commodity code (e.g., WTI, BRENT, URANIUM) or ALL_COMMODITIES for the global index<\/td><\/tr><tr><td>api_token<\/td><td>Yes<\/td><td>Your EODHD API token<\/td><\/tr><tr><td>fmt<\/td><td>No<\/td><td>Response format: json (default) or csv<\/td><\/tr><tr><td>interval<\/td><td>No<\/td><td>Data frequency: daily, weekly, monthly (default), quarterly, annual<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-response-format\">Response Format<\/h2>\n\n\n\n<p>The API returns a JSON object with three sections: <strong>meta<\/strong> (commodity metadata), <strong>data<\/strong> (price history), and <strong>links<\/strong> (pagination).<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"json\" class=\"language-json\">{\n    \"meta\": {\n        \"name\": \"US Regular All Formulations Gas Price\",\n        \"interval\": \"monthly\",\n        \"unit\": \"Dollars per Gallon\",\n        \"offset\": 0,\n        \"limit\": 1000,\n        \"total\": 13\n    },\n    \"data\": [\n        {\"date\": \"2026-03-01\", \"value\": 3.99},\n        {\"date\": \"2026-02-01\", \"value\": 2.937},\n        {\"date\": \"2026-01-01\", \"value\": 2.853}\n    ],\n    \"links\": {\n        \"next\": null\n    }\n}<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Field<\/th><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>meta.name<\/td><td>string<\/td><td>Full commodity name from FRED<\/td><\/tr><tr><td>meta.interval<\/td><td>string<\/td><td>Data frequency (daily, weekly, monthly, quarterly, annual)<\/td><\/tr><tr><td>meta.unit<\/td><td>string<\/td><td>Measurement unit (e.g., Dollars per Barrel, Index 2016 = 100)<\/td><\/tr><tr><td>meta.total<\/td><td>integer<\/td><td>Total number of data points available<\/td><\/tr><tr><td>data[].date<\/td><td>string<\/td><td>Date in YYYY-MM-DD format<\/td><\/tr><tr><td>data[].value<\/td><td>number<\/td><td>Price or index value<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-available-commodities\">Available Commodities<\/h2>\n\n\n\n<p>The API covers 23 commodity series across three categories:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-energy-10-series\">Energy (10 series)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Name<\/th><th>Unit<\/th><th>Frequency<\/th><\/tr><\/thead><tbody><tr><td>WTI<\/td><td>Crude Oil WTI (Cushing, Oklahoma)<\/td><td>Dollars per Barrel<\/td><td>Daily<\/td><\/tr><tr><td>BRENT<\/td><td>Crude Oil Brent (Europe)<\/td><td>Dollars per Barrel<\/td><td>Daily<\/td><\/tr><tr><td>NATURAL_GAS<\/td><td>Henry Hub Natural Gas Spot Price<\/td><td>Dollars per Million BTU<\/td><td>Daily<\/td><\/tr><tr><td>GASOLINE_US<\/td><td>US Regular All Formulations Gas Price<\/td><td>Dollars per Gallon<\/td><td>Weekly<\/td><\/tr><tr><td>DIESEL_USGULF<\/td><td>No. 2 Diesel (US Gulf Coast)<\/td><td>Dollars per Gallon<\/td><td>Daily<\/td><\/tr><tr><td>HEATING_OIL_NYH<\/td><td>No. 2 Heating Oil (NY Harbor)<\/td><td>Dollars per Gallon<\/td><td>Daily<\/td><\/tr><tr><td>JET_FUEL_USGULF<\/td><td>Kerosene-Type Jet Fuel (US Gulf Coast)<\/td><td>Dollars per Gallon<\/td><td>Daily<\/td><\/tr><tr><td>PROPANE_MBTX<\/td><td>Propane (Mont Belvieu, Texas)<\/td><td>Dollars per Gallon<\/td><td>Daily<\/td><\/tr><tr><td>COAL_AU<\/td><td>Coal (Australian thermal)<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><tr><td>URANIUM<\/td><td>Uranium (Global Spot Price)<\/td><td>Dollars per Pound<\/td><td>Monthly<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-metals-3-series\">Metals (3 series)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Name<\/th><th>Unit<\/th><th>Frequency<\/th><\/tr><\/thead><tbody><tr><td>ALUMINUM<\/td><td>Global Price of Aluminum<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><tr><td>COPPER<\/td><td>Global Price of Copper<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><tr><td>NICKEL<\/td><td>Global Price of Nickel<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-agricultural-7-series\">Agricultural (7 series)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Name<\/th><th>Unit<\/th><th>Frequency<\/th><\/tr><\/thead><tbody><tr><td>WHEAT<\/td><td>Global Price of Wheat<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><tr><td>CORN<\/td><td>Global Price of Corn<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><tr><td>SUGAR<\/td><td>Global Price of Sugar<\/td><td>Cents per Pound<\/td><td>Monthly<\/td><\/tr><tr><td>COTTON<\/td><td>Global Price of Cotton<\/td><td>Cents per Pound<\/td><td>Monthly<\/td><\/tr><tr><td>RUBBER<\/td><td>Global Price of Rubber<\/td><td>Dollars per Kilogram<\/td><td>Monthly<\/td><\/tr><tr><td>COFFEE<\/td><td>Global Price of Coffee (Arabica)<\/td><td>Cents per Pound<\/td><td>Monthly<\/td><\/tr><tr><td>SOYBEANS<\/td><td>Global Price of Soybeans<\/td><td>Dollars per Metric Ton<\/td><td>Monthly<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-indices-3-series\">Indices (3 series)<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Code<\/th><th>Name<\/th><th>Unit<\/th><th>Frequency<\/th><\/tr><\/thead><tbody><tr><td>ALL_COMMODITIES<\/td><td>Global Price Index of All Commodities<\/td><td>Index 2016 = 100<\/td><td>Monthly<\/td><\/tr><tr><td>ENERGY_INDEX<\/td><td>Energy Price Index<\/td><td>Index 2016 = 100<\/td><td>Monthly<\/td><\/tr><tr><td>NATGAS_EU<\/td><td>Natural Gas Price (EU)<\/td><td>Dollars per Million BTU<\/td><td>Monthly<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-quick-start-python\">Quick Start: Python<\/h2>\n\n\n\n<p>Fetch the latest WTI crude oil prices:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">import requests\n\nAPI_TOKEN = \"YOUR_API_TOKEN\"\n\ndef get_commodity(code, interval=\"monthly\"):\n    url = f\"https:\/\/eodhd.com\/api\/commodities\/historical\/{code}\"\n    params = {\"api_token\": API_TOKEN, \"fmt\": \"json\", \"interval\": interval}\n    response = requests.get(url, params=params)\n    return response.json()\n\n# Monthly WTI prices\ndata = get_commodity(\"WTI\")\nprint(f\"Commodity: {data['meta']['name']}\")\nprint(f\"Unit: {data['meta']['unit']}\")\nprint(f\"Total records: {data['meta']['total']}\")\n\nfor row in data[\"data\"][:5]:\n    print(f\"  {row['date']}: ${row['value']}\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Output:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code class=\"\">Commodity: Crude Oil Prices: West Texas Intermediate (WTI) - Cushing, Oklahoma\nUnit: Dollars per Barrel\nTotal records: 13\n\n  2026-03-01: $104.69\n  2026-02-01: $66.96\n  2026-01-01: $64.5\n  2025-12-01: $57.26\n  2025-11-01: $58.58<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-using-intervals\">Using Intervals<\/h2>\n\n\n\n<p>The <strong>interval<\/strong> parameter controls the data frequency. Available values: <strong>daily<\/strong>, <strong>weekly<\/strong>, <strong>monthly<\/strong> (default), <strong>quarterly<\/strong>, <strong>annual<\/strong>. Not all intervals are available for every commodity \u2014 it depends on the underlying FRED data source.<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\"># Daily WTI prices \u2014 much more granular\ndaily = get_commodity(\"WTI\", interval=\"daily\")\nprint(f\"Daily records: {daily['meta']['total']}\")\n\nfor row in daily[\"data\"][:5]:\n    print(f\"  {row['date']}: ${row['value']}\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Output:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code class=\"\">Daily records: 249\n\n  2026-03-30: $104.69\n  2026-03-27: $101.26\n  2026-03-26: $96.18\n  2026-03-25: $95.82\n  2026-03-24: $93.26<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-building-a-commodity-dashboard\">Building a Commodity Dashboard<\/h2>\n\n\n\n<p>Fetch multiple commodities and compare their recent performance:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">import requests\n\nAPI_TOKEN = \"YOUR_API_TOKEN\"\n\ndef get_commodity(code, interval=\"monthly\"):\n    url = f\"https:\/\/eodhd.com\/api\/commodities\/historical\/{code}\"\n    params = {\"api_token\": API_TOKEN, \"fmt\": \"json\", \"interval\": interval}\n    return requests.get(url, params=params).json()\n\ncommodities = [\"WTI\", \"BRENT\", \"NATURAL_GAS\", \"ALUMINUM\", \"COPPER\", \"WHEAT\"]\n\nprint(f\"{'Code':&lt;15} {'Name':&lt;45} {'Latest':&gt;10} {'Unit':&lt;25}\")\nprint(\"-\" * 100)\n\nfor code in commodities:\n    data = get_commodity(code)\n    meta = data[\"meta\"]\n    latest = data[\"data\"][0] if data[\"data\"] else None\n\n    print(f\"{code:&lt;15} {meta['name'][:44]:&lt;45} \"\n          f\"{'$' + str(latest['value']) if latest else 'N\/A':&gt;10} \"\n          f\"{meta['unit']:&lt;25}\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Output:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code class=\"\">Code            Name                                          Latest Unit\n--------------------------------------------------------------------------\nWTI             Crude Oil Prices: West Texas Intermediate      $104.69 Dollars per Barrel\nBRENT           Crude Oil Prices: Brent - Europe                $99.33 Dollars per Barrel\nNATURAL_GAS     Henry Hub Natural Gas Spot Price                 $4.38 Dollars per Million BTU\nALUMINUM        Global Price of Aluminum                      $2614.58 Dollars per Metric Ton\nCOPPER          Global Price of Copper                        $9474.24 Dollars per Metric Ton\nWHEAT           Global Price of Wheat                          $249.18 Dollars per Metric Ton<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-year-over-year-comparison\">Year-over-Year Comparison<\/h2>\n\n\n\n<p>Compare current prices with the same month last year to identify trends:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">def yoy_comparison(code):\n    \"\"\"Compare latest monthly value with same month a year ago.\"\"\"\n    data = get_commodity(code, interval=\"monthly\")\n    meta = data[\"meta\"]\n    records = data[\"data\"]\n\n    if len(records) &lt; 13:\n        return None\n\n    current = records[0]\n    year_ago = records[12]\n\n    change = ((current[\"value\"] - year_ago[\"value\"]) \/ year_ago[\"value\"]) * 100\n\n    return {\n        \"name\": meta[\"name\"],\n        \"unit\": meta[\"unit\"],\n        \"current_date\": current[\"date\"],\n        \"current_value\": current[\"value\"],\n        \"year_ago_date\": year_ago[\"date\"],\n        \"year_ago_value\": year_ago[\"value\"],\n        \"yoy_change_pct\": round(change, 1),\n    }\n\nenergy = [\"WTI\", \"BRENT\", \"NATURAL_GAS\", \"GASOLINE_US\"]\n\nprint(f\"{'Commodity':&lt;15} {'Current':&gt;10} {'Year Ago':&gt;10} {'YoY Change':&gt;12}\")\nprint(\"-\" * 50)\n\nfor code in energy:\n    result = yoy_comparison(code)\n    if result:\n        direction = \"+\" if result[\"yoy_change_pct\"] &gt; 0 else \"\"\n        print(f\"{code:&lt;15} ${result['current_value']:&gt;8} \"\n              f\"${result['year_ago_value']:&gt;8} \"\n              f\"{direction}{result['yoy_change_pct']}%\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-loading-into-pandas-dataframe\">Loading into Pandas DataFrame<\/h2>\n\n\n\n<p>For deeper analysis, load commodity data into a Pandas DataFrame:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">import pandas as pd\n\ndef commodity_to_dataframe(code, interval=\"monthly\"):\n    \"\"\"Fetch commodity data and return as a Pandas DataFrame.\"\"\"\n    data = get_commodity(code, interval=interval)\n    df = pd.DataFrame(data[\"data\"])\n    df[\"date\"] = pd.to_datetime(df[\"date\"])\n    df = df.set_index(\"date\").sort_index()\n    df.attrs[\"name\"] = data[\"meta\"][\"name\"]\n    df.attrs[\"unit\"] = data[\"meta\"][\"unit\"]\n    return df\n\n# Load WTI daily prices\nwti = commodity_to_dataframe(\"WTI\", interval=\"daily\")\n\nprint(f\"{wti.attrs['name']}\")\nprint(f\"Date range: {wti.index.min().date()} to {wti.index.max().date()}\")\nprint(f\"Records: {len(wti)}\")\nprint(f\"\\nDescriptive statistics:\")\nprint(wti.describe())\n\n# Calculate 20-day moving average\nwti[\"ma_20\"] = wti[\"value\"].rolling(window=20).mean()\nprint(f\"\\nLatest value: ${wti['value'].iloc[-1]:.2f}\")\nprint(f\"20-day MA: ${wti['ma_20'].iloc[-1]:.2f}\")<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<h2 class=\"wp-block-heading\" id=\"h-correlation-analysis\">Correlation Analysis<\/h2>\n\n\n\n<p>Compare price movements across commodities to find correlations:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code lang=\"python\" class=\"language-python\">import pandas as pd\n\ncodes = [\"WTI\", \"BRENT\", \"NATURAL_GAS\", \"COPPER\", \"ALUMINUM\"]\n\n# Fetch all commodities and merge on date\nframes = {}\nfor code in codes:\n    df = commodity_to_dataframe(code)\n    frames[code] = df[\"value\"]\n\ncombined = pd.DataFrame(frames).dropna()\n\n# Calculate monthly returns\nreturns = combined.pct_change().dropna()\n\n# Correlation matrix\nprint(\"Correlation Matrix (Monthly Returns)\")\nprint(\"=\" * 60)\nprint(returns.corr().round(2).to_string())<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>Output:<\/p>\n\n\n\n            <div class=\"code__wrapper\">\n                <div class=\"code__content\">\n                    \n<pre class=\"wp-block-code\"><code class=\"\">Correlation Matrix (Monthly Returns)\n============================================================\n              WTI  BRENT  NATURAL_GAS  COPPER  ALUMINUM\nWTI          1.00   0.97         0.38    0.52      0.45\nBRENT        0.97   1.00         0.35    0.50      0.44\nNATURAL_GAS  0.38   0.35         1.00    0.21      0.18\nCOPPER       0.52   0.50         0.21    1.00      0.72\nALUMINUM     0.45   0.44         0.18    0.72      1.00<\/code><\/pre>\n\n                <\/div>\n                <div class=\"code__btns\">\n                    <button class=\"code__copy\" class=\"copy\" title=\"Copy url\">\n                        <svg class=\"code__copy__icon\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                            <use xlink:href=\"\/img\/icons\/copy.svg#copy\"><\/use>\n                        <\/svg>\n                        <img decoding=\"async\" class=\"code__copy__approve\" alt=\"\" src=\"\/img\/approve_ico.svg\" loading=\"eager\">\n                    <\/button>\n                <\/div>\n            <\/div>\n        \n\n\n<p>WTI and Brent are highly correlated (0.97) as expected. Copper and Aluminum also show strong co-movement (0.72), both being industrial metals sensitive to global manufacturing demand.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-data-source-and-update-frequency\">Data Source and Update Frequency<\/h2>\n\n\n\n<p>All commodity data is sourced from the <strong>Federal Reserve Economic Data (FRED)<\/strong> maintained by the Federal Reserve Bank of St. Louis. Update frequency depends on the underlying series:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Daily series<\/strong> (WTI, Brent, Natural Gas, Diesel, Heating Oil, Jet Fuel, Propane) \u2014 updated every business day<\/li>\n\n\n\n<li><strong>Weekly series<\/strong> (Gasoline) \u2014 updated every Monday<\/li>\n\n\n\n<li><strong>Monthly series<\/strong> (Metals, Agricultural, Indices, Coal, Uranium) \u2014 updated once per month, typically with a 1-2 month lag<\/li>\n<\/ul>\n\n\n\n<p>Data goes back to 1986 for major energy commodities (WTI, Brent) and to the 1990s for most metals and agricultural commodities.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-api-endpoints-summary\">API Endpoints Summary<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Endpoint<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>GET \/api\/commodities\/historical\/{CODE}<\/td><td>Historical prices for a specific commodity<\/td><\/tr><tr><td>GET \/api\/commodities\/historical\/ALL_COMMODITIES<\/td><td>Global commodity price index<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>All endpoints require authentication via <strong>api_token<\/strong> parameter. The Commodities API is available across all plans, including free plan.<\/p>\n\n\n\n<p class=\"has-text-align-center\"><a class=\"maxbutton-1 maxbutton maxbutton-subscribe-to-api external-css btn\" href=\"https:\/\/eodhd.com\/register\"><span class='mb-text'>Sign up &amp; Get Data<\/span><\/a><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The EODHD Commodities API provides historical price data for 23 commodity series sourced from the Federal Reserve Economic Data (FRED). It covers energy, metals, and agricultural commodities with daily, weekly, monthly, quarterly, and annual intervals \u2014 going back decades for most series. All code examples use Python. You will need an EODHD API subscription that [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[119],"tags":[160,162,156,163,159,158,157,161],"coding-language":[],"ready-to-go-solution":[],"qualification":[],"financial-apis-category":[],"financial-apis-manuals":[],"class_list":["post-7868","post","type-post","status-publish","format-standard","hentry","category-alternative-data-financial-api","tag-brent","tag-coal","tag-commodities","tag-copper","tag-gas","tag-gold","tag-oil","tag-wti"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.6 (Yoast SEO v26.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta) | EODHD APIs Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)\" \/>\n<meta property=\"og:description\" content=\"The EODHD Commodities API provides historical price data for 23 commodity series sourced from the Federal Reserve Economic Data (FRED). It covers energy, metals, and agricultural commodities with daily, weekly, monthly, quarterly, and annual intervals \u2014 going back decades for most series. All code examples use Python. You will need an EODHD API subscription that [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\" \/>\n<meta property=\"og:site_name\" content=\"Stock Price Data, Financial and Stock Market API\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eodhistoricaldata\" \/>\n<meta property=\"article:published_time\" content=\"2026-04-07T14:31:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-07T15:28:05+00:00\" \/>\n<meta name=\"author\" content=\"a.pletnev\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:site\" content=\"@EOD_data\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"a.pletnev\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#article\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\"},\"author\":{\"name\":\"a.pletnev\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/ed3193541c25b73e823a83bdcdb09b5d\"},\"headline\":\"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)\",\"datePublished\":\"2026-04-07T14:31:46+00:00\",\"dateModified\":\"2026-04-07T15:28:05+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\"},\"wordCount\":800,\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"keywords\":[\"brent\",\"coal\",\"commodities\",\"copper\",\"gas\",\"gold\",\"oil\",\"wti\"],\"articleSection\":[\"4. Alternative &amp; Derived Data\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\",\"name\":\"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta) | EODHD APIs Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\"},\"datePublished\":\"2026-04-07T14:31:46+00:00\",\"dateModified\":\"2026-04-07T15:28:05+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/eodhd.com\/financial-apis\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#website\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"name\":\"Historical Stock Prices and Fundamental Financial Data APIs | EODHD\",\"description\":\"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API\",\"publisher\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#organization\",\"name\":\"EODHD (EOD Historical Data)\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"contentUrl\":\"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png\",\"width\":159,\"height\":82,\"caption\":\"EODHD (EOD Historical Data)\"},\"image\":{\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/eodhistoricaldata\",\"https:\/\/x.com\/EOD_data\",\"https:\/\/www.reddit.com\/r\/EODHistoricalData\/\",\"https:\/\/eod-historical-data.medium.com\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/ed3193541c25b73e823a83bdcdb09b5d\",\"name\":\"a.pletnev\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/020e454749b61223b72b1bf96e7978ccdd1e39b04585b29698da3767a193a57d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/020e454749b61223b72b1bf96e7978ccdd1e39b04585b29698da3767a193a57d?s=96&d=mm&r=g\",\"caption\":\"a.pletnev\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta) | EODHD APIs Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","og_locale":"en_US","og_type":"article","og_title":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)","og_description":"The EODHD Commodities API provides historical price data for 23 commodity series sourced from the Federal Reserve Economic Data (FRED). It covers energy, metals, and agricultural commodities with daily, weekly, monthly, quarterly, and annual intervals \u2014 going back decades for most series. All code examples use Python. You will need an EODHD API subscription that [&hellip;]","og_url":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","og_site_name":"Stock Price Data, Financial and Stock Market API","article_publisher":"https:\/\/www.facebook.com\/eodhistoricaldata","article_published_time":"2026-04-07T14:31:46+00:00","article_modified_time":"2026-04-07T15:28:05+00:00","author":"a.pletnev","twitter_card":"summary_large_image","twitter_creator":"@EOD_data","twitter_site":"@EOD_data","twitter_misc":{"Written by":"a.pletnev","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#article","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta"},"author":{"name":"a.pletnev","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/ed3193541c25b73e823a83bdcdb09b5d"},"headline":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)","datePublished":"2026-04-07T14:31:46+00:00","dateModified":"2026-04-07T15:28:05+00:00","mainEntityOfPage":{"@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta"},"wordCount":800,"publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"keywords":["brent","coal","commodities","copper","gas","gold","oil","wti"],"articleSection":["4. Alternative &amp; Derived Data"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","url":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta","name":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta) | EODHD APIs Documentation","isPartOf":{"@id":"https:\/\/eodhd.com\/financial-apis\/#website"},"datePublished":"2026-04-07T14:31:46+00:00","dateModified":"2026-04-07T15:28:05+00:00","breadcrumb":{"@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/eodhd.com\/financial-apis\/commodities-api-historical-prices-for-oil-gas-metals-agriculture-beta#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/eodhd.com\/financial-apis"},{"@type":"ListItem","position":2,"name":"Commodities API: Historical Prices for Oil, Gas, Metals &amp; Agriculture (beta)"}]},{"@type":"WebSite","@id":"https:\/\/eodhd.com\/financial-apis\/#website","url":"https:\/\/eodhd.com\/financial-apis\/","name":"Historical Stock Prices and Fundamental Financial Data APIs | EODHD","description":"End Of Day (EOD), Fundamental and Real-time\/Live Data Market API","publisher":{"@id":"https:\/\/eodhd.com\/financial-apis\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/eodhd.com\/financial-apis\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/eodhd.com\/financial-apis\/#organization","name":"EODHD (EOD Historical Data)","url":"https:\/\/eodhd.com\/financial-apis\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/","url":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","contentUrl":"https:\/\/eodhd.com\/financial-apis\/wp-content\/uploads\/2023\/12\/EODHD-Logo.png","width":159,"height":82,"caption":"EODHD (EOD Historical Data)"},"image":{"@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/eodhistoricaldata","https:\/\/x.com\/EOD_data","https:\/\/www.reddit.com\/r\/EODHistoricalData\/","https:\/\/eod-historical-data.medium.com\/"]},{"@type":"Person","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/ed3193541c25b73e823a83bdcdb09b5d","name":"a.pletnev","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/eodhd.com\/financial-apis\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/020e454749b61223b72b1bf96e7978ccdd1e39b04585b29698da3767a193a57d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/020e454749b61223b72b1bf96e7978ccdd1e39b04585b29698da3767a193a57d?s=96&d=mm&r=g","caption":"a.pletnev"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p8NjB1-22U","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/7868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/comments?post=7868"}],"version-history":[{"count":8,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/7868\/revisions"}],"predecessor-version":[{"id":7879,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/posts\/7868\/revisions\/7879"}],"wp:attachment":[{"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/media?parent=7868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/categories?post=7868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/tags?post=7868"},{"taxonomy":"coding-language","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/coding-language?post=7868"},{"taxonomy":"ready-to-go-solution","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/ready-to-go-solution?post=7868"},{"taxonomy":"qualification","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/qualification?post=7868"},{"taxonomy":"financial-apis-category","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/financial-apis-category?post=7868"},{"taxonomy":"financial-apis-manuals","embeddable":true,"href":"https:\/\/eodhd.com\/financial-apis\/wp-json\/wp\/v2\/financial-apis-manuals?post=7868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}