# Price API Read-only online pharmacy prices for the pharmaceutical industry. ## Auth Create a key in the dashboard (Settings → API keys) or start a device login: ``` POST /v1/auth/device { "client_name": "Claude" } ``` Open https://preciosfarmacias.cl/activar and enter the code. Then poll `POST /v1/auth/token` with the `device_code` every 5 seconds. Store the `pf_live_` key (or `pf_test_` on preview) and send `Authorization: Bearer`. ## Glossary - su: substance - mc: drug (substance + strength + form) - pc: product (brand + lab) - pce: pack - BE: bioequivalent - Cenabast max price - capturedAt: the Santiago day the price was seen - match confidence: barcode, registro, ai, manual, cache, or legacy ## Endpoints - GET /v1/lab/me - GET /v1/lab/search?q=sertralina&type=substance - GET /v1/lab/products/{pcId} - GET /v1/lab/products/{pcId}/offers - GET /v1/lab/products/{pcId}/history - GET /v1/lab/compare - GET /v1/lab/drugs/{mcId}/market - GET /v1/lab/changes?since=YYYY-MM-DD - GET /v1/lab/portfolio - GET /v1/lab/favorites - GET /v1/lab/pharmacies - GET /v1/lab/openapi.json ## Limits Starter is 20 requests per minute per key, 1,000 calls per day, and 20,000 rows per day. A 429 includes Retry-After. Prices are whole pesos and online prices only. They can differ from the store. ## Examples ``` curl -H "Authorization: Bearer $PF_KEY" https://pf-api.ricardosiebertg.workers.dev/v1/lab/me curl -H "Authorization: Bearer $PF_KEY" "https://pf-api.ricardosiebertg.workers.dev/v1/lab/search?q=sertralina&type=substance" ```