Skip to content

Open-Inflation/endpoint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

endpoint

Read-only HTTP API over catalog database generated by converter.

Install

python3 -m venv .venv
./.venv/bin/pip install -r requirements.txt

Run

export ENDPOINT_CATALOG_DB='sqlite:///../converter/data/catalog.db'
./.venv/bin/python main.py

Public endpoints

  • GET /healthz
  • GET /products
  • GET /products/{canonical_product_id}
  • GET /products/{canonical_product_id}/sources
  • GET /products/{canonical_product_id}/snapshots
  • GET /products/{canonical_product_id}/dynamics
  • GET /categories
  • GET /categories/{category_id}
  • GET /settlements
  • GET /settlements/{settlement_id}
  • GET /sync/cursors

All routes are read-only (GET only).

Dynamics endpoint

GET /products/{canonical_product_id}/dynamics

Required query params:

  • parser_name
  • source_id
  • field: price, discount_price, loyal_price, rating, reviews_count, available_count, package_quantity
  • date_from (ISO8601 with timezone)
  • date_to (ISO8601 with timezone)
  • interval: 1h, 6h, 1d, 7d

Response shape:

{
  "dates": ["2026-02-01T00:00:00Z", "2026-02-02T00:00:00Z"],
  "values": [99.9, null],
  "meta": {
    "canonical_product_id": "prod-1",
    "parser_name": "fixprice",
    "source_id": "receiver:run-1:1",
    "field": "price",
    "interval": "1d",
    "date_from": "2026-02-01T00:00:00Z",
    "date_to": "2026-02-02T23:59:59Z"
  }
}

Recommended DB index

CREATE INDEX idx_catalog_snapshots_series
ON catalog_product_snapshots(canonical_product_id, parser_name, source_id, observed_at);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages