Dev.to WebDev 🛠 Dev 👁 0 📖 2 min read

The Per-Slug Route Behind Our Own Catalogue: 43 Single-Record Answers and Two Different 404s

The Per-Slug Route Behind Our Own Catalogue: 43 Single-Record Answers and Two Different 404s I work on OnePassApps, so this is our own API, and every number below was measured on it today over plain HTTPS from a signed

The Per-Slug Route Behind Our Own Catalogue: 43 Single-Record Answers and Two Different 404s

I work on OnePassApps, so this is our own API, and every number below was measured on it today over plain HTTPS from a signed-out session: no API key, no cookie, no browser, no writes.

The route I had not opened

GET https://api.onepassapps.com/api/products is the catalogue: one answer carrying all 43 records in 15,650 bytes. Behind it sits a second route I had never fetched, and no post I have published touches it:

GET https://api.onepassapps.com/api/products/<slug>

I asked for all 43 slugs the catalogue itself lists, one request each. Every one answered 200.

The same record, one at a time

Each answer's data object is the catalogue's record for that slug - the same eleven fields, the same values - compared as sorted-key JSON: 43 of 43 identical, no differences anywhere.

The sizes move with the length of the name and the two note strings: 374 bytes for signaldesk (NewsFlow) up to 464 bytes for budget-meal-planner (Budget Meal Planner), 28 distinct sizes across the 43 answers.

Here is the part that made me look twice. Fetching all 43 of them one at a time costs 18,252 bytes over 43 requests. Fetching the whole catalogue in a single request costs 15,650 bytes over one. So the 43 single-record routes are 2,602 bytes more to carry exactly what one request already carries - the 43 envelopes and 43 request ids cost more than the records do.

Two different 404s

An unknown slug is not answered the way an unknown route is.

  • /api/products/does-not-exist-zz answers 404 in 146 bytes, error code PRODUCT_NOT_FOUND, message: No example product exists for that slug.
  • /api/products//movie-tracker and /api/products/movie-tracker/cast answer 404 in 124 bytes with the generic NOT_FOUND envelope instead: That route does not exist.

That is the whole difference between "no such product" and "no such route": 124 bytes against 146, and one error code against the other. The generic envelope has its own post - https://dev.to/onepassapps/the-catalogue-route-on-our-api-host-43-records-22-enabled-one-renamed-slug-h9d

The edges around it

  • /api/products/ with an empty slug answers 200 with the full catalogue, 15,650 bytes.
  • /api/products/movie-tracker/ with a trailing slash answers 200 with the same 396-byte record as the path without the slash.
  • /api/products/MOVIE-TRACKER answers 404 in 146 bytes. The lookup is case-sensitive: the slug is the catalogue's slug exactly.
  • /api/products/movie-tracker?slug=movie-tracker answers 200 with the same 396-byte record. The parameter is ignored on this route too, as it is on the list route - https://dev.to/onepassapps/our-api-host-ignores-the-query-string-ten-shapes-one-answer-43-records-every-time-3jla

What I did not do

No writes of any kind, no API key, no cookie, no browser, no session. One build, one day (10 November 2026), one network. I did not look at a signed-in session, and I did not check whether a slug that is not in the catalogue today would answer anything else later.

Try it

https://app.onepassapps.com?utm_source=devto&utm_medium=post&utm_campaign=per-slug-catalogue-route&utm_content=app-link

https://app.onepassapps.com/guides?utm_source=devto&utm_medium=post&utm_campaign=per-slug-catalogue-route&utm_content=guides-link

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.