Skip to main content

Units, and what each call costs

Quavsit is metered in units: 1 per read, 5 per journey search, 1 per stream event, and nothing for errors, health, status or a 304.

J
Written by Jean-Baptiste COULON--CHABAGNO

Quavsit is metered in units, counted per calendar month in UTC.

Call

Units

Any read endpoint

1

GET /journeys

5

Each departures or vehicles event on a stream

1

GET /health, GET /status, 304 Not Modified, errors

0

Units are charged only after a successful response. A request that fails costs nothing.

Reading your own meter

Three headers come back on every response:

Header

Value

X-Quavsit-Units

Units charged by this call

X-Quavsit-Units-Remaining

Units left this month, or unlimited

X-Quavsit-Period-End

When the monthly counter resets

GET /usage gives the full picture, and the account page shows this period, the last seven days, and usage per key.

Spending less

  • Use conditional requests. Static resources — networks, lines, stops, shapes — carry an ETag. Send If-None-Match and a 304 Not Modified costs no units.

  • Respect the cache headers. Every response carries Cache-Control with the TTL of its freshest source: 10 to 20 seconds for real-time, 300 seconds for static data. Polling faster than that buys nothing but units.

  • Ask for an area rather than each platform. An area aggregates the departures of all its stop points in one call.

  • Journeys cost five. Cache a result you are going to show twice.

The same units pay for everything

API keys, departure boards and embedded widgets all spend the same monthly units, from the same plan, under the same overage setting and the same spend cap. A board refreshing every 30 seconds is competing with your API calls for the same budget.

The per-minute limit is separate

Requests are also counted per minute, per account. Exceeding the plan's figure is refused with a Retry-After header, and nothing is charged. The window is a rolling one, so spread traffic rather than batching it at the top of the minute.

If the figures do not add up

Compare X-Quavsit-Units on your own calls with the per-key usage on the account page. A gap between them is a board or a widget spending the same budget.

Quavern help reference: quavsit-units/en

Did this answer your question?