{"success":true,"data":{"year":2026,"month":6,"prices":{"diesel_50ppm":{"coastal":28,"inland":29.26},"petrol_93":{"coastal":27.16,"inland":27.95},"petrol_95":{"coastal":27.19,"inland":28.06}}},"meta":{"effective_date":"2026-06-03","next_update":"2026-07-01","cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24855/get+latest+prices' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":{"year":2026,"month":6,"fuel_type":"petrol_95","region":"inland","price_zar":28.06,"effective_date":"2026-06-03"},"meta":{"next_update":"2026-07-01","cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24856/get+latest+price+-+single+fuel+type&fuel_type=Required&/=Required®ion=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{
"success": true,
"data": [
{
"year": 2026,
"month": 6,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 28.06,
"effective_date": "2026-06-03"
},
{
"year": 2026,
"month": 5,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 26.63,
"effective_date": "2026-05-06"
},
{
"year": 2026,
"month": 4,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.36,
"effective_date": "2026-04-01"
},
{
"year": 2026,
"month": 3,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 20.3,
"effective_date": "2026-03-04"
},
{
"year": 2026,
"month": 2,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 20.1,
"effective_date": "2026-02-04"
},
{
"year": 2026,
"month": 1,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 20.75,
"effective_date": "2026-01-07"
},
{
"year": 2025,
"month": 12,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.41,
"effective_date": "2025-12-03"
},
{
"year": 2025,
"month": 11,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.12,
"effective_date": "2025-11-05"
},
{
"year": 2025,
"month": 10,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.63,
"effective_date": "2025-10-01"
},
{
"year": 2025,
"month": 9,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.55,
"effective_date": "2025-09-03"
},
{
"year": 2025,
"month": 8,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.59,
"effective_date": "2025-08-06"
},
{
"year": 2025,
"month": 7,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.87,
"effective_date": "2025-07-02"
},
{
"year": 2025,
"month": 6,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.35,
"effective_date": "2025-06-04"
},
{
"year": 2025,
"month": 5,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.4,
"effective_date": "2025-05-07"
},
{
"year": 2025,
"month": 4,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.62,
"effective_date": "2025-04-02"
},
{
"year": 2025,
"month": 3,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.34,
"effective_date": "2025-03-05"
},
{
"year": 2025,
"month": 2,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.41,
"effective_date": "2025-02-05"
},
{
"year": 2025,
"month": 1,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.59,
"effective_date": "2025-01-01"
},
{
"year": 2024,
"month": 12,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.47,
"effective_date": "2024-12-04"
},
{
"year": 2024,
"month": 11,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.3,
"effective_date": "2024-11-06"
},
{
"year": 2024,
"month": 10,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.05,
"effective_date": "2024-10-02"
},
{
"year": 2024,
"month": 9,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.19,
"effective_date": "2024-09-04"
},
{
"year": 2024,
"month": 8,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.11,
"effective_date": "2024-08-07"
},
{
"year": 2024,
"month": 7,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.26,
"effective_date": "2024-07-03"
},
{
"year": 2024,
"month": 6,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 24.25,
"effective_date": "2024-06-05"
},
{
"year": 2024,
"month": 5,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 25.49,
"effective_date": "2024-05-01"
},
{
"year": 2024,
"month": 4,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 25.12,
"effective_date": "2024-04-03"
},
{
"year": 2024,
"month": 3,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 24.45,
"effective_date": "2024-03-06"
},
{
"year": 2024,
"month": 2,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.24,
"effective_date": "2024-02-07"
},
{
"year": 2024,
"month": 1,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.49,
"effective_date": "2024-01-03"
},
{
"year": 2023,
"month": 12,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.25,
"effective_date": "2023-12-06"
},
{
"year": 2023,
"month": 11,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.9,
"effective_date": "2023-11-01"
},
{
"year": 2023,
"month": 10,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 25.68,
"effective_date": "2023-10-04"
},
{
"year": 2023,
"month": 9,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 24.54,
"effective_date": "2023-09-06"
},
{
"year": 2023,
"month": 8,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.83,
"effective_date": "2023-08-02"
},
{
"year": 2023,
"month": 7,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.46,
"effective_date": "2023-07-06"
},
{
"year": 2023,
"month": 6,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.63,
"effective_date": "2023-06-07"
},
{
"year": 2023,
"month": 5,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 23.34,
"effective_date": "2023-05-03"
},
{
"year": 2023,
"month": 4,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.97,
"effective_date": "2023-04-05"
},
{
"year": 2023,
"month": 3,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 22.95,
"effective_date": "2023-03-01"
},
{
"year": 2023,
"month": 2,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.68,
"effective_date": "2023-02-01"
},
{
"year": 2023,
"month": 1,
"fuel_type": "petrol_95",
"region": "inland",
"price_zar": 21.4,
"effective_date": "2023-01-04"
}
],
"meta": {
"count": 217,
"filters": {
"fuel_type": "petrol_95",
"region": "inland"
},
"next_update": "2026-07-01",
"cached": false
}
}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24857/get+price+history?fuel_type=petrol_95®ion=inland' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":{"year":2024,"month":3,"prices":{"diesel_50ppm":{"coastal":21.93,"inland":22.62},"petrol_93":{"coastal":23.41,"inland":24.13},"petrol_95":{"coastal":23.73,"inland":24.45}}},"meta":{"effective_date":"2024-03-06","next_update":"2024-04-03","cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24858/get+price+by+month&year=Required&/=Required&month=Required' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":[{"year":2026,"month":6,"price_zar":28.06,"effective_date":"2026-06-03","change_zar":1.43,"change_pct":5.37},{"year":2026,"month":5,"price_zar":26.63,"effective_date":"2026-05-06","change_zar":3.27,"change_pct":14},{"year":2026,"month":4,"price_zar":23.36,"effective_date":"2026-04-01","change_zar":3.06,"change_pct":15.07},{"year":2026,"month":3,"price_zar":20.3,"effective_date":"2026-03-04","change_zar":0.2,"change_pct":1},{"year":2026,"month":2,"price_zar":20.1,"effective_date":"2026-02-04","change_zar":-0.65,"change_pct":-3.13},{"year":2026,"month":1,"price_zar":20.75,"effective_date":"2026-01-07","change_zar":-0.66,"change_pct":-3.08},{"year":2025,"month":12,"price_zar":21.41,"effective_date":"2025-12-03","change_zar":0.29,"change_pct":1.37},{"year":2025,"month":11,"price_zar":21.12,"effective_date":"2025-11-05","change_zar":-0.51,"change_pct":-2.36},{"year":2025,"month":10,"price_zar":21.63,"effective_date":"2025-10-01","change_zar":0.08,"change_pct":0.37},{"year":2025,"month":9,"price_zar":21.55,"effective_date":"2025-09-03","change_zar":-0.04,"change_pct":-0.19},{"year":2025,"month":8,"price_zar":21.59,"effective_date":"2025-08-06","change_zar":-0.28,"change_pct":-1.28},{"year":2025,"month":7,"price_zar":21.87,"effective_date":"2025-07-02","change_zar":null,"change_pct":null}],"meta":{"fuel_type":"petrol_95","region":"inland","months":12,"cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24859/get+price+trend?fuel_type=petrol_95®ion=inland&months=12' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":{"fuel_type":"petrol_95","region":"inland","from":{"year":2020,"month":1,"price_zar":16.16,"effective_date":"2020-01-01"},"to":{"year":2026,"month":5,"price_zar":26.63,"effective_date":"2026-05-06"},"change_zar":10.47,"change_pct":64.79},"meta":{"cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24860/compare+prices+between+two+months?fuel_type=petrol_95®ion=inland&from=2020-01&to=2026-05' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":{"next_update":"2026-07-01","days_until":9},"meta":{"cached":false}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24861/get+next+update+date' --header 'Authorization: Bearer YOUR_API_KEY'
{"success":true,"data":{"status":"ok","timestamp":"2026-06-22T15:05:37.201Z"}}
curl --location --request GET 'https://zylalabs.com/api/12761/sa+fuel+price+api/24862/health+check' --header 'Authorization: Bearer YOUR_API_KEY'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 SA燃油价格 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
返回内陆和沿海地区的93号无铅汽油、95号无铅汽油和50ppm柴油的当前和历史价格历史数据从2008年1月到现在可用价格每周三上午08:00南非标准时间自动更新
价格每周三早上08:00南非标准时间更新 DMRE在每个月的第一个周三宣布新的油泵价格 如果由于油价或汇率波动发生月中调整 将在下一个周三反映
历史数据从2008年1月到现在可用 — 超过18年的南非燃料价格记录
93号汽油 ULP 95号汽油 ULP 和 50ppm 柴油适用于内陆和沿海地区 照明煤油栏目在模式中存在但目前为空因为来源数据不可用
DMRE根据内陆和沿海地区的运输和物流成本差异设定不同的油泵价格 内陆价格(豪登省及周边省份)通常略高于沿海价格(西开普省、夸祖鲁-纳塔尔省、东开普省)
所有价格以南非兰特(ZAR)每升返回
由于源数据存在缺口,数据集缺少五个月:2011年7月、2014年12月、2015年2月、2015年7月和2021年9月 通过/month/:year/:month请求这些月份将返回404
/最新 返回所有燃料类型和两个地区的嵌套响应 - 当您需要完整的价格榜时非常有用 /最新/:燃料类型/:地区 返回一个特定燃料类型和地区的单一价格 - 当您的应用程序只需要一个值并且您想要更小、更快的响应时非常有用
使用/compare端点 传递您的燃料类型 区域 从月份和到月份以YYYY-MM格式 API将返回这两个时间点的价格以及以南非兰特和百分比表示的变化 例:/compare?fuel_type=petrol_95®ion=inland&from=2020-01&to=2026-05
所有错误返回一致的 JSON 结构: { "error": true, "code": "NOT_FOUND", "message": "未找到 2007-01 的燃料价格数据" } 常见的错误代码为 BAD_REQUEST (400) 用于无效参数和 NOT_FOUND (404) 用于没有数据的月份
每个端点返回与南非燃油价格相关的JSON数据数据包括当前价格历史记录价格趋势比较和下次更新时间具体取决于使用的端点
主要字段包括“成功”(布尔值)“数据”(包含相关价格信息的对象)“目标”(来源和更新的细节)以及特定字段如“价格_zar”“有效日期”和“变化_pct”用于趋势分析
响应数据采用JSON格式构建,包含一个最上层的“success”字段,后面是一个“data”对象,包含相关的价格详细信息,以及一个“meta”对象,用于源和更新信息
参数因端点而异。例如,/latest/:fuel_type/:region 端点需要 "fuel_type"(例如,petrol_95)和 "region"(例如,inland) /compare 端点需要 YYYY-MM格式的 "from" 和 "to" 日期
每个端点提供特定信息:最新价格历史价格记录价格趋势比较两个月的价格以及下一次燃油价格更新的日期
用户可以通过指定参数,如燃料类型、地区、年份和月份,来自定义请求。例如,要获取沿海地区的93号汽油历史数据,请使用/history?fuel_type=petrol_93®ion=coastal
数据来源于南非矿物资源和石油部(DMRE),确保信息的官方性和可靠性
典型的用例包括燃料价格监测 财务分析 燃料开支预算以及依赖燃料成本的公司的趋势分析