PretCarburant.ro Public API — REST v1
Programmatic access to aggregated Romanian fuel price data. Same data we use on the site, refreshed every 2 hours, no authentication required. Licensed Creative Commons BY 4.0 — free to use with attribution.
Available Endpoints
Base URL: https://pretcarburant.ro/api/v1/. All responses are JSON with Cache-Control: public, max-age=300 and Access-Control-Allow-Origin: * on public endpoints.
| Endpoint | Description | Rate limit |
|---|---|---|
GET /api/v1/preturi |
City-aggregated prices (optional filter ?judet=CLUJ) |
None (5-min cache) |
GET /api/v1/preturi/minime |
National min/avg/max prices per fuel type | None (5-min cache) |
GET /api/v1/judete/<judet> |
County-level aggregated average price (e.g. /api/v1/judete/CLUJ) |
1 request/week per IP |
GET /api/v1/retele |
Monitored networks with brand-aggregated prices | 1 request/week per IP |
GET /api/v1/statii |
Station list with coordinates, brand, prices (filters: ?brand=, ?tip=, ?lat=&lon=&raza= for stations within radius, km) Each record includes a stable per-station id. |
1 request/week per IP |
GET /api/v1/statie/<station_id>/istoric |
Price history for one station (station_id = the id field from /api/v1/statii; unknown id → 404) |
1 request/week per IP |
GET /api/v1/geocode |
City-name autocomplete (?q=cluj, min 2 characters) |
1 request/week per IP |
POST /api/v1/traseu/custom |
Stations along an A→B route (JSON body: start, end, tip) |
1 request/week per IP |
cURL Examples
City-aggregated prices
curl -s https://pretcarburant.ro/api/v1/preturi | jq '.rezultate[0]'
Filter by county
curl -s "https://pretcarburant.ro/api/v1/preturi?judet=CLUJ" | jq '.rezultate'
National minimum prices
curl -s https://pretcarburant.ro/api/v1/preturi/minime | jq '.preturi'
Petrom stations selling diesel
curl -s "https://pretcarburant.ro/api/v1/statii?brand=petrom&tip=motorina_standard" | jq '.statii | length'
Stations within 10 km (lat/lon)
curl -s "https://pretcarburant.ro/api/v1/statii?lat=46.77&lon=23.62&raza=10" | jq '.total'
County average price
curl -s https://pretcarburant.ro/api/v1/judete/CLUJ | jq
Rate Limits and AI Bot Policy
Anonymous users hit 1 request/week/IP on rate-limited endpoints (/retele, /statii, /istoric). The /preturi and /preturi/minime endpoints are rate-limit-free (5-minute cache).
AI assistants (ChatGPT, Claude, Perplexity, Gemini, Bing Copilot, etc.) are bypassed via an explicit User-Agent whitelist. They get a 60 req/min/IP cap instead, so they can cite our data directly in answers. Whitelisted UAs include: GPTBot, ChatGPT-User, OAI-SearchBot, ClaudeBot, anthropic-ai, PerplexityBot, Google-Extended, Googlebot, Applebot-Extended, Bytespider, Meta-ExternalAgent, CCBot, MistralAI, cohere-ai, YouBot, DiffBot, Bravebot and others.
Response Format
All responses share this shape:
{
"status": "ok",
"data": "2026-05-07",
"preturi_lipsa": "null",
"rezultate": [...]
}
On error:
{
"status": "error",
"message": "Rate limit: 1 request per week...",
"retry_after_seconds": 543210
}
Missing prices: null, not 0
When we do not have a fuel price for a city or a network, the field comes back as null. No fuel costs zero lei — the real ranges are 5.50–12.00 RON/L for petrol, 5.50–13.00 for diesel and 2.50–6.00 for LPG — so a 0 would not be a measurement but a made-up value that drags down any average computed over our response. The rule applies to /preturi (both rezultate[] and retele[]), /preturi/minime (the min, mediu, max fields), /judete/<judet> and /retele.
Only price fields are converted. A 0 in total, nr_orase, lat or lng stays 0, because there zero is a real answer, not a missing value. The pret field in /statii was already null before this change.
{
"oras": "Turda", "slug": "turda", "judet": "CJ",
"lat": 46.5667, "lng": 23.7833,
"benzina": 7.15, "benzina_premium": null,
"motorina": 7.40, "motorina_premium": null, "gpl": null
}
For integrations that cannot be updated alongside us, ?zeros=1 (?zeros=true also works) restores the exact previous behaviour, with 0 instead of null:
curl -s "https://pretcarburant.ro/api/v1/preturi?zeros=1" | jq '.rezultate[0]'
Every response declares its own convention in the preturi_lipsa field: "null" (default) or "zero" (with ?zeros=1). Read it in code instead of assuming — it is the only reliable way to know what you got. The conversion only goes one way: a null never becomes 0, not even with ?zeros=1, because /judete/<judet> already answered null when it had nothing to average.
License and Attribution
Data is published under Creative Commons BY 4.0. Free to use commercially or non-commercially with visible attribution: "Source: PretCarburant.ro (https://pretcarburant.ro)".
The full dataset is also published on Zenodo with DOI: 10.5281/zenodo.19560194. Organization identity on Wikidata: Q139285387.
Commercial / high-volume access
The free CC-BY 4.0 tier stays unchanged: 1 request/week per IP on rate-limited endpoints, with visible attribution. We are not closing or capping it — public data stays public.
For apps, fleets, newsrooms and any high-volume integration, there are commercial plans with instant activation — your API key arrives by email within minutes of subscribing:
- Starter — €19/month, 10,000 requests/month
- Pro — €49/month, 100,000 requests/month
- Business — €149/month, 1,000,000 requests/month, priority support
All plans include a 3-day free trial, access to every endpoint without the weekly quota, and X-RateLimit-* headers for usage monitoring. See plans and subscribe →
Special needs (contractual SLA, bulk export, historical snapshots, extended rights without attribution)? Write to us for a dedicated quote.
Version History
- v1.0 (2026-04-01) — initial 5 public endpoints; 5-min cache; open CORS.
- v1.1 (2026-04-14) — bot UA whitelist for AI assistants; per-IP 60 req/min flood cap.
- v1.2 (2026-05-07) — formal public documentation at
/api(RO/EN/HU). - v1.3 (2026-07-26) — self-serve commercial plans with API keys (
X-Api-Keyheader), per-plan monthly quotas and theX-RateLimit-Limit/X-RateLimit-Remainingheaders;/geocodeand/traseu/customendpoints documented. - v1.4 (2026-08-16) — missing prices are returned as
nullinstead of0on/preturi,/preturi/minime,/judeteand/retele; the?zeros=1parameter restores the old format, and thepreturi_lipsafield states which convention each response used.
Contact and Bug Reports
Email: contact@pretcarburant.ro. For technical bugs or feature requests, prefix the subject with „[API]". We reply within 48 business hours.
Responsible disclosure for security issues: see /.well-known/security.txt.