Skip to content

fix: keep API JSON out of Google results - #160

Merged
brunobuddy merged 1 commit into
mainfrom
block-api-indexing
Jul 28, 2026
Merged

fix: keep API JSON out of Google results#160
brunobuddy merged 1 commit into
mainfrom
block-api-indexing

Conversation

@brunobuddy

Copy link
Copy Markdown
Member

💭 Why

Search Console shows Google crawling 18 /api/v1/*.json URLs. Those are machine payloads, not pages. They add nothing in search results and eat crawl budget that should go to the model, provider and parameter pages.

✨ What changed

  • /api/v1/* now returns X-Robots-Tag: noindex (vercel.json for prod, Express middleware for dev/test parity).
  • Internal links to .json endpoints get rel="nofollow" (model page, footer, "How to use" panel).
  • /api, the HTML docs page, added to the sitemap. It was indexable but missing.
  • New buildRobotsTxt helper, so the crawl policy is tested instead of inlined in the build script.

👤 For users

Nothing changes. Every endpoint stays public, CORS-enabled and fetchable. Only search engines are asked to skip them.

📝 Notes

robots.txt deliberately does not Disallow: /api/. Blocking the crawl would hide the noindex header and leave the 18 URLs stuck in the index as bare links. They need to be crawled once more to be dropped.
Deindexing takes a few weeks. Worth re-checking Search Console after the next crawl.

Google had started indexing /api/v1/*.json endpoints (18 URLs in Search
Console). Those are machine payloads, not pages, and they dilute the
crawl budget that should go to the model, provider and parameter pages.

Serve /api/v1 with X-Robots-Tag: noindex (vercel.json for prod, an
Express middleware for dev/test parity) and drop rel="nofollow" on every
internal link to a .json endpoint. The endpoints stay public and
crawlable on purpose: a robots.txt Disallow would hide the noindex and
strand the already-discovered URLs in the index.

Also adds /api, the HTML docs page, to the sitemap. It was canonical and
indexable but missing from it.
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelparams.dev Ready Ready Preview Jul 28, 2026 8:13am

Request Review

@github-actions github-actions Bot added the site Website code or tooling label Jul 28, 2026
@brunobuddy
brunobuddy merged commit 3baf8e3 into main Jul 28, 2026
5 checks passed
@brunobuddy
brunobuddy deleted the block-api-indexing branch July 28, 2026 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

site Website code or tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant