MarketDB API: Difference between revisions
(Created page with "== MarketDB API == The MarketDB API serves pre-generated JSON snapshot files for vending, buying and trend data. This endpoint is snapshot-based: * API requests do ''not'' execute live database queries. * Responses are served from JSON files which are usually refreshed every 5 minutes. == Endpoint == Typical request format: <pre> https://flux.muhro.eu/?module=marketdb&action=api&name=<dataset> </pre> == Query Parameters == {| class="wikitable" ! Parameter !...") |
|||
| (One intermediate revision by the same user not shown) | |||
| Line 120: | Line 120: | ||
* <code>MarketDbCache.ApiCacheSeconds = 300</code> (5 minutes) | * <code>MarketDbCache.ApiCacheSeconds = 300</code> (5 minutes) | ||
== | == Rate Limits == | ||
=== Rate Limiting === | === Rate Limiting === | ||
* <code>120</code> requests per minute | * <code>120</code> requests per minute | ||
== Status Codes == | == Status Codes == | ||
Latest revision as of 06:01, 12 April 2026
MarketDB API
The MarketDB API serves pre-generated JSON snapshot files for vending, buying and trend data.
This endpoint is snapshot-based:
- API requests do not execute live database queries.
- Responses are served from JSON files which are usually refreshed every 5 minutes.
Endpoint
Typical request format:
https://flux.muhro.eu/?module=marketdb&action=api&name=<dataset>
Query Parameters
| Parameter | Required | Description |
|---|---|---|
name
|
Yes | Dataset to fetch. |
key
|
No | currently not used |
Available Datasets
| Dataset | Description | Notes |
|---|---|---|
vendings
|
Current vendor shop list. | Shop-level snapshot. |
v_vending
|
Items currently for sale. | Full rows from the vending cache view. |
v_buying
|
Items currently being bought. | Full rows from the buying cache view. |
buyingstores
|
Current buying shop list. | Shop-level snapshot. |
vending_trend_daily
|
Full daily sales trend dataset. | Includes all available day buckets and items. |
vending_trend_hourly
|
Full hourly sales trend dataset. | Includes all available hour buckets and items. |
vending_last_sales
|
Latest sales log snapshot. | Currently limited to 1000 rows. |
vending_trend_daily_latest
|
Rolling summary for the last 24 hours. | Ordered by sales_count descending.
|
vending_trend_hourly_latest
|
Rolling summary for the last 60 minutes. | Ordered by sales_count descending.
|
vending_last_sales_latest
|
Latest sales feed. | Currently the same 1000-row payload as vending_last_sales.
|
meta
|
Snapshot metadata. | Includes generated_at and server.
|
Example Requests
https://flux.muhro.eu/?module=marketdb&action=api&name=vendings https://flux.muhro.eu/?module=marketdb&action=api&name=v_vending https://flux.muhro.eu/?module=marketdb&action=api&name=v_buying https://flux.muhro.eu/?module=marketdb&action=api&name=buyingstores https://flux.muhro.eu/?module=marketdb&action=api&name=vending_trend_daily_latest https://flux.muhro.eu/?module=marketdb&action=api&name=vending_trend_hourly_latest https://flux.muhro.eu/?module=marketdb&action=api&name=vending_last_sales_latest
Response Headers
| Header | Description |
|---|---|
Content-Type
|
application/json; charset=utf-8
|
Cache-Control
|
Public cache header with max-age from MarketDbCache.ApiCacheSeconds.
|
ETag
|
Entity tag based on the snapshot file and modification time. |
Last-Modified
|
Snapshot file modification timestamp in GMT. |
Content-Encoding
|
Set to gzip when gzip is enabled and supported by the client.
|
Default cache TTL:
MarketDbCache.ApiCacheSeconds = 300(5 minutes)
Rate Limits
Rate Limiting
120requests per minute
Status Codes
| Status | Meaning |
|---|---|
200
|
Snapshot returned successfully. |
304
|
The client cache is still valid for the current ETag.
|
403
|
Invalid or missing API key when key protection is enabled. |
404
|
Unknown dataset name or snapshot file missing. |
429
|
Rate limit exceeded. |
500
|
MarketDb cache configuration is missing. |