indexgap indexnow

command

IndexNow for one project or the whole portfolio.

setup makes a key for each project, writes the key file (<key>.txt, containing the key) into the publish root — --key-dir, or public/ or static/ next to indexgap.json — and records key, key_dir and, with --sitemap, the sitemap under "indexnow" in indexgap.json. A project that is already set up is left alone; --rotate issues a new key; a missing key file is written again. With --portfolio portfolio.json it does the same for every project, each with its own key, since a key belongs to one domain. No network. push --changed sends what changed: by default the sitemap URLs whose lastmod is on or after the last accepted submission (or --since YYYY-MM-DD), or with --source git the pages whose files changed in git since --since <revision>; --urls takes a ready list. URLs without lastmod and URLs of another host are skipped and counted. The URLs go to api.indexnow.org (batches of up to 10,000, no redirects followed, accepted batches kept on a later failure). Without --send nothing leaves the machine; with --send every answer is appended to .indexgap-indexnow.jsonl next to indexgap.json, and the next run starts from it. The first --send without a log and without --since needs --first, so a missing log never resubmits a whole site by accident. A sitemap given as a URL is downloaded only with --fetch. push --source manifest (the old notify command is its alias; the pages directory goes right after push) submits only what changed since the last run, using the content manifest, so a thousand-page site does not resubmit itself daily. One request goes to the global endpoint api.indexnow.org, which shares it with every participant, in batches of up to 10,000 URLs (the protocol's limit). The participants (Bing, Yandex, Naver, Seznam, Yep, Amazon and the Internet Archive) are read from the indexnow.org registry, with the list in indexgap/data/indexnow.json as the fallback when the registry cannot be reached. Google does not take part in IndexNow: for Google there is the sitemap and Search Console. Google's Indexing API is allowed only for pages with JobPosting or BroadcastEvent (in a VideoObject) markup, and spreading submissions over several accounts to get around its quota is against its terms, so indexgap does not send ordinary pages there. Baidu is not an IndexNow participant either. Paid “indexers” are not supported and not recommended. --yandex-recrawl, with --send, also puts the changed URLs into the Yandex Webmaster recrawl queue (OAuth token in YANDEX_WEBMASTER_TOKEN); the daily quota is read from the API each time, URLs over the quota are left to IndexNow, and the call is free. On Vercel, send the queue once the deploy is live, not during the build: run indexgap indexnow push --source manifest --send from a job that a successful deployment triggers (GitHub Actions on deployment_status, or a Vercel webhook for deployment.succeeded). A Deploy Hook only starts a build, so a site rebuilt by a Deploy Hook sends from that follow-up job too. A postbuild script should only write the key file (--write-key --key-dir public) and print the dry run: the new pages are not online yet at that point. Keep .indexgap-manifest.json committed so a clean build does not see every page as new.

Send after the deploy: Vercel and CI

Submit once the new pages are online, never during the build: participants fetch the URL and the key file right away. A build step (or postbuild) may only run indexgap indexnow setup, which writes the key file into public/, and a dry run. On Vercel, send from a GitHub Actions job that a successful deployment triggers (Vercel reports deployments to GitHub, so deployment_status fires for each one). The checkout in CI is fresh, so there is no log from the previous run: give the window explicitly, by git revision or by date.

name: IndexNow
on: deployment_status
jobs:
  push:
    if: github.event.deployment_status.state == 'success' && github.event.deployment.environment == 'Production'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 2
      - run: pipx install indexgap
      # pages kept as files in the repository (Markdown, HTML):
      - run: indexgap indexnow push --changed --source git --since HEAD~1 --send
      # or from the live sitemap's lastmod:
      # - run: indexgap indexnow push --changed --sitemap https://example.com/sitemap.xml --fetch --since "$(date -u -d yesterday +%F)" --send

For a portfolio, run the same job in each repository, or one scheduled job with indexgap indexnow push --changed --portfolio portfolio.json --since … --send. The key is not a secret (its file is public), so it lives in indexgap.json, not in CI secrets.

Usage

usage: indexgap indexnow [-h] [--portfolio portfolio.json] [--config CONFIG]
                         [--site SITE] [--key-dir KEY_DIR] [--rotate]
                         [--key KEY] [--changed] [--urls urls.txt]
                         [--source {sitemap,git,manifest}] [--sitemap SITEMAP]
                         [--since SINCE] [--first] [--fetch] [--online]
                         [--send] [--manifest MANIFEST]
                         [--key-location KEY_LOCATION] [--out-dir OUT_DIR]
                         [--write-key] [--offline] [--yandex-recrawl]
                         {setup,push} [root]

positional arguments:
  {setup,push}          setup — key, key file and the record in indexgap.json;
                        push — send the changed URLs
  root                  push --source manifest: the pages directory; from
                        indexgap.json by default

options:
  -h, --help            show this help message and exit
  --portfolio portfolio.json
                        every project of the portfolio, each with its own key
  --config CONFIG       path to indexgap.json; by default looked up in the
                        current directory and above
  --site SITE           the full site address; taken from indexgap.json by
                        default
  --key-dir KEY_DIR     setup: where to put the key file — the publish ROOT;
                        by default public/ or static/ next to indexgap.json
  --rotate              setup: issue a new key even if there is one
  --key KEY             push: the key, if indexgap.json has none
  --changed             push: changed URLs — by sitemap lastmod or by git diff
  --urls urls.txt       push: a ready list of URLs, one per line
  --source {sitemap,git,manifest}
                        push: where changes come from — sitemap lastmod, git
                        diff or the content manifest; sitemap by default
  --sitemap SITEMAP     the build's sitemap.xml; by default "indexnow".sitemap
                        from indexgap.json or the project's sitemap field in
                        the portfolio
  --since SINCE         sitemap: a date YYYY-MM-DD (by default the last
                        accepted submission in the log); git: a revision, for
                        example HEAD~1
  --first               first submission: there is no log yet, and the whole
                        sitemap should go
  --fetch               allow downloading the sitemap from a URL
  --online              turn on every network read of this command: --fetch.
                        Writes nothing to outside services — only --send does
                        that
  --send                actually submit; without it this is a dry run
  --manifest MANIFEST   path to the manifest; next to indexgap.json by default
  --key-location KEY_LOCATION
                        URL of the key file, if it is not at the root
  --out-dir OUT_DIR     publish directory
  --write-key           create the key file
  --offline             do not fetch the participant registry, use the built-
                        in list
  --yandex-recrawl      with --send, also put the changed URLs into the Yandex
                        Webmaster recrawl queue, within the daily quota read
                        from the API. Token: YANDEX_WEBMASTER_TOKEN

The rest of the pipeline

← timeline · bing →