ClickBus nearest low-fare date
The date nearest to a given day on which ClickBus has a low fare between two places (the place ids /clickbus/v1/trips returns as place_id). Search after, before or both ways.
Every response includes credits_used: the credits this call cost.
Part of the ClickBus API: 9 endpoints with prices, use cases and example responses.
Parameters
| name | type | description |
|---|---|---|
origin_idrequired | integer | Origin place id (departure.place_id in /clickbus/v1/trips). Example: 4017 |
destination_idrequired | integer | Destination place id (arrival.place_id). Example: 3827 |
date | string | Reference date, YYYY-MM-DD. Default: days_ahead. |
days_ahead | integer | Reference date this many days from today (default 30). |
direction | both | after | before | Search direction (default both). |
interval_days | integer | Search window in days, 1-90. |
Every endpoint also takes fresh, raw, fields (see lean responses and caching).
Example
curl "https://api.api.sh/clickbus/v1/low-fare-date?origin_id=4017&destination_id=3827" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/clickbus/v1/low-fare-date",
params={"origin_id": "4017", "destination_id": "3827"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/clickbus/v1/low-fare-date");
url.searchParams.set("origin_id", "4017");
url.searchParams.set("destination_id", "3827");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
Example response (real call, trimmed: lists cut to 2 items, long text shortened, raw left out)
{"origin_id": 4017,"destination_id": 3827,"date": "2026-12-04","direction": "both","interval_days": null,"nearest_low_fare_date": "2026-12-03","cached": false,"credits_used": 1}