Fare endpoint
GET /fare fetches a live Grab fare quote between two GPS points.
GET https://api.taxiscrape.com/fareQuery parameters
Section titled “Query parameters”The coordinate parameters are required. format is optional and defaults to simple.
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
from_lat | query | number, double | Yes | Pickup latitude. |
from_lon | query | number, double | Yes | Pickup longitude. |
to_lat | query | number, double | Yes | Dropoff latitude. |
to_lon | query | number, double | Yes | Dropoff longitude. |
format | query | string | No | simple for normalized fare data, full for the original Grab payload wrapped under grab. simplified is accepted as an alias for simple. |
Authentication
Section titled “Authentication”Authenticated requests use your dashboard API key:
Authorization: Bearer <API key>Requests without this header are still accepted, but they share a small global unauthenticated abuse limit.
cURL example
Section titled “cURL example”curl -s \ -H 'Authorization: Bearer <API key>' \ 'https://api.taxiscrape.com/fare?from_lat=1.3644&from_lon=103.9915&to_lat=1.3048&to_lon=103.8318&format=simple'JavaScript example
Section titled “JavaScript example”const params = new URLSearchParams({ from_lat: '1.3644', from_lon: '103.9915', to_lat: '1.3048', to_lon: '103.8318', format: 'simple',});
const response = await fetch(`https://api.taxiscrape.com/fare?${params}`, { headers: { Authorization: 'Bearer <API key>', },});
if (!response.ok) { throw new Error(`TaxiScrape request failed: ${response.status}`);}
const data = await response.json();const firstService = data.grab.services[0];
console.log(firstService.name, firstService.fare.display);Example response
Section titled “Example response”The 200 response is returned as application/json; charset=utf-8.
By default the endpoint returns the simple format. It keeps the generated geocoding metadata at the top level and puts normalized Grab services under grab.services:
{ "__api_geocoding_found": { "from": { "address": "Changi Airport, Changi", "keywords": "Changi Airport" }, "to": { "address": "2 Orchard Turn, #B4-70, Ion Orchard, Singapore, 238801", "keywords": "GoGo Franks - Ion Orchard" } }, "grab": { "servicesListID": "1f14fa76-36f4-62aa-804e-909ac1b84895", "ttl": 28, "services": [ { "id": 13804, "name": "Standard: 4 seater (Car)", "category": "Ride", "group": "Airport", "capacity": "4", "description": "2x large luggage", "eta": { "displayText": "3 mins away", "distance": 0, "duration": 0 }, "paymentMethods": ["CASH", "CARD"], "fare": { "display": "S$27.30", "currency": { "code": "SGD", "exponent": 2, "symbol": "S$" }, "lowerBound": 2730, "upperBound": 2730, "fixed": true, "seatsRequested": 1 } } ] }}Use format=full when you need the complete upstream payload:
{ "__api_geocoding_found": { "from": { "address": "Changi Airport, Changi", "keywords": "Changi Airport" }, "to": { "address": "2 Orchard Turn, #B4-70, Ion Orchard, Singapore, 238801", "keywords": "GoGo Franks - Ion Orchard" } }, "grab": { "categoryGroups": [ { "groups": [ { "name": "Airport", "services": [ { "ID": 13804, "name": "Standard: 4 seater (Car)", "display": { "capacity": "4", "description": "2x large luggage" }, "quote": { "lowerBound": 2730, "upperBound": 2730, "signature": "..." } } ] } ] } ], "ttl": 28 }}Reading fare amounts
Section titled “Reading fare amounts”Fare values are returned in the smallest currency unit for the returned currency. Use quote.currency.exponent to format a display amount.
function formatFare(fare) { const units = fare.finalFare ?? fare.lowerBound; const amount = units / 10 ** fare.currency.exponent;
return new Intl.NumberFormat('en', { style: 'currency', currency: fare.currency.code, }).format(amount);}The simple response also includes fare.display, which is preformatted for quick display.
Field notes
Section titled “Field notes”| Field | Meaning |
|---|---|
__api_geocoding_found.from | Pickup location resolved by TaxiScrape before requesting fares. |
__api_geocoding_found.to | Dropoff location resolved by TaxiScrape before requesting fares. |
grab.services[] | Normalized ride products returned in format=simple. |
grab.services[].name | Display name of a ride product. |
grab.services[].eta.displayText | Human-readable pickup wait time. |
grab.services[].fare.display | Preformatted fare text. |
grab.services[].fare.currency | Currency metadata for the quote. |
grab.services[].fare.lowerBound | Lower fare bound in minor units. |
grab.services[].fare.upperBound | Upper fare bound in minor units. |
grab.services[].fare.finalFare | Final fare if the upstream response provides one. |
grab.services[].fare.fixed | Whether the quote is fixed. |
grab.categoryGroups[].groups[].services[] | Original Grab service list returned in format=full. |
Status codes
Section titled “Status codes”| Status | Meaning |
|---|---|
200 | Fare data returned. |
400 | Query parameters are invalid, including an unsupported format. |
401 | API key is malformed or invalid. |
402 | Authenticated account has no credits left. |
429 | Unauthenticated global rate limit exceeded. |
502 | Upstream provider error. |
503 | Service unavailable. |
See Error responses for the error body format.