openapi: 3.2.0 info: title: PageAudit Audits API version: f5ac3ca0 description: 'Technical SEO auditor that ships the fix. Main client: AI agents. Browsable index at GET /api/.' servers: - url: https://pageaudit.online tags: - name: Audits paths: /api/audits/{id}: get: operationId: get_audit summary: Re-reads an audit already made, in full, without re-auditing the page description: 'Re-reading costs nothing and does not count against the allowance — the page''s HTML is not kept, but the report is. Returns: { audit_id, url, score, summary{finalUrl,status,contentType,title,metaDescription,canonical,robots,viewport,charset,lang,favicon,faviconSource,h1s,openGraph,twitter,jsonLdCount,jsonLdBlocks,jsonLdDropped,jsonLdTypes,images,links,words,hreflang,legacy,redirects,robotsTxt,sitemap}, counts{errors,warnings,info}, issues[{severity,code,message}], fixes[{code,severity,classe,alvo,snippet,arquivo,fonte,nota}], jsonLd, headers, truncated, share_slug, created_at }' security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string responses: '200': description: '{ audit_id, url, score, summary{finalUrl,status,contentType,title,metaDescription,canonical,robots,viewport,charset,lang,favicon,faviconSource,h1s,openGraph,twitter,jsonLdCount,jsonLdBlocks,jsonLdDropped,jsonLdTypes,images,links,words,hreflang,legacy,redirects,robotsTxt,sitemap}, counts{errors,warnings,info}, issues[{severity,code,message}], fixes[{code,severity,classe,alvo,snippet,arquivo,fonte,nota}], jsonLd, headers, truncated, share_slug, created_at }' content: application/json: schema: $ref: '#/components/schemas/AuditGravado' '401': description: No credential, or an invalid one. See this endpoint's auth. '404': description: The resource does not exist (or is not yours — the API does not tell the two apart on purpose). tags: - Audits /api/audits/{id}/patch: get: operationId: get_patch summary: 'The consolidated patch of an audit: the block ready to paste, the files to…' description: 'Each finding becomes a fix in one of three classes: `deterministico` (comes whole from what the page declares: final URL, title, description, OG), `molde` (a tag with a marked placeholder, like `{{TITULO}}`, and the suggested source) or `sem_patch` (a decision or infrastructure, with the instruction). Nothing is invented by a model. Returns: { url, audit, head, arquivos[{code,path,conteudo}], moldes[{code,alvo,snippet,fonte,nota}], sem_patch[{code,nota}], resumo{deterministicos,moldes,sem_patch,total}, como_aplicar, _links }' security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string responses: '200': description: '{ url, audit, head, arquivos[{code,path,conteudo}], moldes[{code,alvo,snippet,fonte,nota}], sem_patch[{code,nota}], resumo{deterministicos,moldes,sem_patch,total}, como_aplicar, _links }' content: application/json: schema: $ref: '#/components/schemas/Patch' '401': description: No credential, or an invalid one. See this endpoint's auth. '404': description: The resource does not exist (or is not yours — the API does not tell the two apart on purpose). tags: - Audits /api/audits/{id}/share: post: operationId: post_api_audits_by_id_share summary: Publishes the audit under a non-enumerable slug. description: 'Returns: { ok, shared, slug, path, badge, _links }' security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string responses: '200': description: '{ ok, shared, slug, path, badge, _links }' content: application/json: schema: $ref: '#/components/schemas/Compartilhamento' '401': description: No credential, or an invalid one. See this endpoint's auth. '404': description: The resource does not exist (or is not yours — the API does not tell the two apart on purpose). tags: - Audits delete: operationId: delete_api_audits_by_id_share summary: Revokes the share; the slug stops serving the report description: 'The badge keeps answering 200 with the grey `n/a` SVG — same box, so the layout of whoever pasted it in a README does not break. Returns: { ok, shared }' security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string responses: '200': description: '{ ok, shared }' content: application/json: schema: type: object properties: ok: type: boolean description: Always `true`. shared: type: boolean description: Always `false` at the end of this call. required: - ok - shared '401': description: No credential, or an invalid one. See this endpoint's auth. '404': description: The resource does not exist (or is not yours — the API does not tell the two apart on purpose). tags: - Audits components: schemas: ArquivoPatch: type: object properties: code: type: string description: Finding that originated it (`robots_txt_missing`, `sitemap_missing`). path: type: string description: Absolute path on the host, e.g. `/robots.txt`. conteudo: type: string description: Full content of the file. required: - code - path - conteudo description: A file to create at the host root. AuditGravado: type: object properties: audit_id: type: string description: ID of the audit. url: type: string description: Final audited URL, after following the redirects. score: type: integer description: Score from 0 to 100. summary: allOf: - $ref: '#/components/schemas/ResumoPagina' description: What the page declared at the time of the run. nullable: true counts: allOf: - $ref: '#/components/schemas/ContagemAchados' description: How many findings of each severity. issues: type: array items: $ref: '#/components/schemas/Achado' description: Everything found in that run. fixes: type: array items: $ref: '#/components/schemas/Correcao' description: The ready fix of each finding; an audit stored before this existed gets the computation on read. jsonLd: type: array items: type: object description: The raw JSON-LD blocks stored. headers: type: object description: Headers of the target's response, as they were in the run. truncated: type: array items: type: string description: What was cut by size when storing. share_slug: type: string description: Public slug, if this audit was shared. nullable: true created_at: type: string description: When the run happened (UTC). required: - audit_id - url - score - summary - counts - issues - fixes - jsonLd - headers - truncated - share_slug - created_at description: The same report re-read from the database. It has no `quota` and no `_links` (it is a read, not a run) and gains the date and the share slug. ContagemAchados: type: object properties: errors: type: integer description: Serious findings. warnings: type: integer description: Findings that deserve attention. info: type: integer description: Observations without severity. required: - errors - warnings - info description: How many findings of each severity — the summary that fits in a badge. SemPatch: type: object properties: code: type: string description: Source finding. nota: type: string description: What to check or decide. required: - code - nota description: 'Finding without an automatic fix: it is a decision or infrastructure.' Compartilhamento: type: object properties: ok: type: boolean description: Always `true`. shared: type: boolean description: Whether the audit is published at the end of the call. slug: type: string description: Public, non-enumerable slug. path: type: string description: Path of the report's HTML page. badge: type: string description: Path of the score badge SVG. _links: type: object description: Report, JSON and badge, as absolute URLs. required: - ok - shared - slug - path - badge - _links description: The result of publishing an audit under a non-enumerable slug. ResumoPagina: type: object properties: finalUrl: type: string description: URL after following every redirect. status: type: integer description: Final HTTP status of the target. contentType: type: string description: Content-Type of the final response. nullable: true title: type: string description: Content of `