What problem does aeo-site-audit solve?
A page can look fine in the browser and still be invisible to search engines and AI answer engines. Common causes are a missing canonical, a description that is too long, broken JSON-LD, no FAQ markup, no og:image, or a stray noindex left over from staging. Even when every page is correct, Google still might not have indexed it, and the only place to see that is Search Console, one URL at a time.
aeo-site-audit does both checks from one command line. audit reads your sitemap and checks every live page for the basics that search and answer engines read. index asks Google's URL Inspection API which of those pages are indexed. It is free and open source at github.com/kilazi/aeo-site-audit.
How does the audit work?
aeo-site-audit audit https://example.com takes the page list from /sitemap.xml, following sitemap index files. It fetches the pages in parallel, eight at a time, and parses each one with Python's HTML parser rather than regexes. Each finding has a check id and a level:
| Check id | Level | What it flags | |---|---|---| | http | error | the page does not return 200 | | noindex | error | a robots meta tag or X-Robots-Tag header says noindex | | title | error | missing, or longer than 60 characters | | description | error | missing, or outside 70-160 characters | | canonical | error | missing, or pointing to a different URL | | h1 | error | not exactly one <h1> | | lang, viewport | error | no <html lang>, no viewport meta | | og | error | any of og:title, og:description, og:image, og:url, twitter:card missing | | og-image | error | the og:image URL does not load | | jsonld | error | no JSON-LD, invalid JSON, or a type you required is missing | | h2, faq | warn | no <h2> headings, no FAQPage in JSON-LD | | img-alt, nofollow | warn | an image without alt, an external link without rel nofollow | | sitemap | error | the site has no /sitemap.xml | | robots, llms | warn | no /robots.txt or no Sitemap line in it, no /llms.txt |
Errors make the command exit 1, so you can run it in CI after every deploy. Warnings only fail the run with --strict.
How does the index check work?
aeo-site-audit index https://example.com builds the same page list. For each URL it calls the Search Console URL Inspection API and prints the verdict, the coverage state (for example "Discovered - currently not indexed") and the last crawl time. It finishes with a count of indexed pages. The property defaults to sc-domain:<your host>. Pass --property https://example.com/ for a URL-prefix property.
It uses only the webmasters.readonly scope and calls only the inspect endpoint, so it cannot submit, request indexing or change anything in your account. Rate limits (HTTP 429) and server errors are retried with backoff. Any other error is reported on that URL's line, and the run continues.
How do I set it up?
Install it with one command. It needs Python 3.9 or newer:
pipx install git+https://github.com/kilazi/aeo-site-auditThe audit needs no setup. For the index check, log in once:
- In Google Cloud Console, create a project and enable the Google Search Console API.
- Under APIs and Services, configure the OAuth consent screen and add yourself as a test user.
- Create an OAuth client ID of type Desktop app and download its JSON file.
- Run
aeo-site-audit login --client-secret client_secret.jsonand approve in the browser that opens.
The login is saved to ~/.config/aeo-site-audit/token.json with mode 0600. Change the location with --token or the AEO_TOKEN variable. On a server or in CI, you can skip the saved login by setting AEO_ACCESS_TOKEN to a token you already have.
Useful flags for both commands: --match /blog/ keeps only matching URLs. --pages urls.txt or --page URL replace the sitemap. --limit N caps the URL count. --json gives machine output, and --out report.md saves the report. For the audit, --own (or AEO_OWN_DOMAINS) lists your other domains so links to them are not flagged. --require-types BlogPosting,BreadcrumbList makes those JSON-LD types mandatory, and --skip faq,nofollow turns checks off.
What can go wrong?
- No pages found. The site has no
/sitemap.xml, or it lives somewhere else. Pass--sitemap URLor a--pagesfile. - Every canonical is flagged. The canonical must match the URL exactly, trailing slash included. Make the sitemap list the canonical form.
- og:image flagged although it works. Some CDNs refuse HEAD requests. The tool then retries with GET, but a CDN that blocks unknown user agents will still fail. Use
--skip og-imageif you trust it. - Index check says HTTP 403. The Google account you logged in with has no access to that property, or the property name is wrong.
sc-domain:properties need the bare domain. - Quota. Google allows about 2,000 inspections a day per property. Use
--matchor--limiton large sites.
Can I reuse the code?
Yes, under Apache-2.0. Keep LICENSE and NOTICE, and credit the repo in your README or NOTICE with one line: Uses aeo-site-audit by Kilazi (https://github.com/kilazi/aeo-site-audit). The same rule is written for coding agents in the repo's AGENTS.md. See also done-check, which makes an AI coding agent run your tests before it says done.
Questions people ask
Can I reuse it?
Yes. aeo-site-audit is Apache-2.0: copy it, change it, ship it in your own product. Keep the LICENSE and NOTICE files with the code, and add one line to your README or NOTICE: Uses aeo-site-audit by Kilazi (https://github.com/kilazi/aeo-site-audit). Coding agents get the same rule in the repo's AGENTS.md.
Does the index check change anything in Search Console?
No. It logs in with the read-only webmasters.readonly scope and only calls the URL Inspection endpoint. It cannot submit URLs, request indexing or edit settings.
Do I need a Google login for the audit?
No. The audit only fetches your public pages, sitemap, robots.txt and llms.txt. The Google login is needed only for the index command, and only once.
What is AEO?
Answer engine optimization: making pages easy for AI assistants and answer boxes to read and quote. In practice that means clean titles and descriptions, valid JSON-LD such as FAQPage, question headings and an llms.txt file, which is what the audit checks.
Can I run it in CI?
Yes. The audit exits 1 when it finds an error, prints JSON with --json, and needs nothing but Python. Run it against your preview or live URL after each deploy.
Does it crawl my whole site?
No. It checks exactly the pages your sitemap lists, or a list you pass with --pages or --page. That keeps runs fast and predictable.
