How this was made
NAFDAC status, joined to Nigerian pharmacy prices. Independent, $0 a month, not endorsed by
NAFDAC or any pharmacy here. Code MIT, data CC-BY-4.0. The register: the agency Dora Akunyili led,
2001–2008. Her tribute is on the front page .
01 · register Register first. No API.
NAFDAC Greenbook . No API. /api/* → 404. No mirror.
HTML. 6 category pages: name, form, strength, number. Detail: status, expiry.
Frozen: 10,967 registrations. 1,856 readable (16.9% ).
Unread ≠ clean. Expired certificates. HTTP only: local checksums.
02 · seed Seed list. Borrowed.
#FixMedPrices , CC-BY-4.0. 1,074 products.
Herbal. Reproductive health. Almost none of what a pharmacy shelves.
03 · catalogue Rebuild. Register is judge.
Linker tool. Rules: name overlaps, strength agrees, form compatible.
Authority: the register . Not the shop's wording.
+359 products → 1,433 .
Priced at freeze: 335 . A catalogue is not a shop shelf.
04 · scrape Scrape. API first.
API first: WooCommerce Store API , Shopify /products.json .
No API? HTML.
Polite: 2 s per host. Python , psycopg . Named User-Agent.
Product and price fields only.
05 · route MedPlus. Wrong door, right door.
Category pages: same 20 links, every page. Dead end.
Drugs route: 20 per page. Page 70: 16 links. Page 71: empty.
128 → 1,396 products.
Night run: 1 h 50 m → 2 h 50 m.
06 · refusals Refusal = failure.
403, 429: stop. Failed row written.
Night fails: over 10% of pages fail, or a full sweep returns under 1,000 records.
Both thresholds: judgement, not measurement. The code says so.
07 · match Two stages. Never similarity alone.
fastembed and bge-small-en-v1.5 , 384 dims, pgvector : top 10.
Then rules: strength, form, ingredient. pg_trgm , unaccent .
Similarity alone: rejected.
Attached 559 of 2,800 . 2,241 not.
08 · guard Strength guard. Late. Costly.
No listing attached to a different strength.
Cleared 54 wrong links across 22 products. No contradictions under the strict check.
Cost: 28 matched listings.
One known false refusal: Augmentin 1 g against 875 mg + 125 mg. 1,000 mg is the sum of the parts.
09 · views Answers are views.
SQL on PostgreSQL : latest, cheapest, two-shop, not-active, 7-day.
2,800 listings. 559 attached. 261 price cells. 44 comparisons. 154 not active.
7-day: 3 products. Works. Market quiet.
10 · index Index refreshed by machine.
mv_drug_price_index . 427 rows.
Refresh: pipeline, not person. A stale index looks like a quiet market.
11 · audit Page proves itself.
Build renders. Re-reads every query. Compares. Disagreement: nothing written.
Last line of the build: 3,791 numbers checked, 0 unexplained .
12 · every price Second page. Every price.
Filters on. Each row → the shop page it came from, the register record behind it.
Links: sources inspectable. Parsing: not proven.
13 · human check Rule first. Verdict after.
20 licence cards. 20 pack cards. Seeded draw. No substitution.
Licence: 18 of 20 judged. All pass. 82–100%.
Pack: 3 of 20 judged. Too few for a rate.
14 · re-read Machine re-read. Narrow reach.
Register: 20 of 20 equal.
Prices: 44 comparisons, 88 page reads. No difference.
Same channels as the scrapers. One shop refused its endpoint.
Proves no drift. Not parser correctness. Not a human check.
15 · freeze Then frozen.
Nightly run = standing promise. Unwatched free tier: stale, unnamed.
12–15 Nov: 5 to 42 changes a night, against 2,800 .
Stopped 16 Nov 2026. Newest price 15 Nov. Schedule off.
16 · export Export before switch-off.
8 tables, 36,936 rows.
PostgreSQL dump. CSV per table. Written schema record. Manifest: one checksum per file.
Published twice: a release on the code repository, a dataset on Hugging Face . Both checked against the manifest on every push.
17 · restore Restore. Then trust the archive.
Every push: empty PostgreSQL 17 , restore, compare manifest. 22 checks.
1,433 embeddings return as 384-dim vectors.
Docker , then the restore check. Throwaway database.
Proves the archive works. Not parser correctness. That is 13.
18 · decisions Decisions. Each with its cost.
One decision per row.
Decision Chosen Cost
Scheduler GitHub Actions cron, not Prefect Free and unlimited on a public
repository. No retry engine. No run history beyond the workflow page.
Database Neon, not Supabase The free tier does not pause after idle
days. It does suspend on inactivity — hence the export.
MedPlus coverage A full sweep every night, not a rotating window About
68 minutes a night. The whole catalogue, not a quarter.
What a comparison means Two pharmacies publishing a price for the same
product Unconfirmed stock still counts. A caveat on the page, not a narrower count.
Inactive licences Labelled, not hidden The finding stays visible, and
so does the reading it rests on.
What was not built No warehouse layer, no ORM, no API SQL files and
scripts. A rebuild means running them in order.
19 · limits What it does not claim.
Not a market index. Not a national price survey. Lagos, three online pharmacies,
335 medicines carrying a price at freeze.
Register status readable for 16.9% . A flagged listing: a
fraction of a fraction.
A lapsed licence is not a fake drug. Nothing was bought, tested or inspected.
Supplements and pharmacy sundries are in the price data. They are not medicines.
One unit price is per millilitre: a 100 ml syrup. The rest are per tablet. The unit is printed beside
every unit price.
44 comparisons rest on a machine re-read and a small
recorded human sample. Not a complete human audit.
Nothing is deployed. A repository, a dated export, generated pages. Not a live service.
Streamlit dashboard: built, never deployed. Unused.
20 · rebuild Rebuild it yourself.
Pinned Python . Not the system interpreter.
Schema in numbered order: 001 to 008.
Then: seed, collect listings, link registrations, match products, build the pages.
Docker running, then the restore check. Throwaway PostgreSQL 17, removed after.
Independence and licence. Not endorsed by NAFDAC and not affiliated with, or paid by,
any pharmacy named in the data. Code MIT; data CC-BY-4.0. The medicine list descends from #FixMedPrices,
CC-BY-4.0, credited as its licence requires. Source and issue tracker:
github.com/batestguy/NaijaDrugWatch .
Photograph: Tolatheart, CC BY-SA 4.0, via Wikimedia
Commons.
This page is one HTML file and one local photograph, both in this directory. No external stylesheet,
script, font or image is fetched, so it works with no network. It is generated from the database, and the
figures above that a query can answer are checked against the database again on every build.