Ahrefs Page content API

The Page content API from Ahrefs — 1 operation(s) for page content.

Operations 1

GET /page-content Page content #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ahrefs-page-content-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ahrefs-page-content-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Site Audit Page content API
  description: Site audit.
  termsOfService: https://ahrefs.com/terms
  contact:
    name: Ahrefs
    url: https://ahrefs.com/
    email: support@ahrefs.com
  version: 3.0.0
servers:
- url: https://api.ahrefs.com/v3/site-audit
  description: Ahrefs Site Audit
security:
- http:
  - read
tags:
- name: Page content
paths:
  /page-content:
    get:
      tags:
      - Page content
      summary: Page content
      description: '>This endpoint consumes a fixed cost of 50 API units per request.'
      operationId: page-content
      parameters:
      - description: 'A comma-separated list of fields to return.


          - `crawl_datetime`

          - `page_text`

          - `page_text_md`

          - `raw_html`

          - `rendered_html`'
        required: true
        explode: false
        schema:
          type: string
        name: select
        in: query
      - description: 'The unique identifier of the project. Only projects with verified ownership are supported. You can find the project ID in the URL of your Site Audit project in Ahrefs: `https://app.ahrefs.com/site-audit/#project_id#`'
        required: true
        explode: false
        schema:
          type: integer
        name: project_id
        in: query
      - description: The URL of the page to retrieve content for.
        required: true
        explode: false
        schema:
          type: string
          format: url
        name: target_url
        in: query
      - description: A timestamp in `YYYY-MM-DDThh:mm:ss` format specifying the crawl date to retrieve metrics from. Defaults to the most recent available crawl if omitted. For scheduled crawls, we return data from the latest crawl finished before the specified timestamp. For Always-on audit crawls, we return data as of the provided date and time. If the time component is omitted, it defaults to `00:00:00`. The timestamp is interpreted in UTC.
        required: false
        explode: false
        schema:
          type: string
          format: date-time
        name: date
        in: query
      - $ref: '#/components/parameters/output_json_php'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/page-content'
            application/xml:
              schema:
                $ref: '#/components/schemas/page-content'
        '400':
          $ref: '#/components/responses/error_400'
        '401':
          $ref: '#/components/responses/error_401'
        '403':
          $ref: '#/components/responses/error_403'
        '429':
          $ref: '#/components/responses/error_429'
        '500':
          $ref: '#/components/responses/error_500'
components:
  responses:
    error_400:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
    error_403:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
    error_500:
      description: Internal Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
    error_401:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
    error_429:
      description: Too Many Requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
  schemas:
    page-content:
      properties:
        page-content:
          properties:
            crawl_datetime:
              type: string
              format: date-time
              title: crawl_datetime
              description: The timestamp when the page was crawled.
            page_text:
              type:
              - string
              - 'null'
              title: page_text
              description: The text extracted from the page content.
            page_text_md:
              type:
              - string
              - 'null'
              title: page_text_md
              description: 'The page content converted to markdown text. The value is a JSON-encoded string: decode JSON escapes (e.g. with `jq -r`) before passing it to a markdown renderer.'
            raw_html:
              type:
              - string
              - 'null'
              title: raw_html
              description: The raw HTML of the page.
            rendered_html:
              type:
              - string
              - 'null'
              title: rendered_html
              description: The rendered HTML of the page.
          type: object
      type: object
      xml:
        name: AhrefsApiResponse
    Error_response:
      properties:
        error:
          type: string
      type: object
      xml:
        name: AhrefsApiResponse
  parameters:
    output_json_php:
      description: The output format.
      required: false
      explode: false
      schema:
        type: string
        enum:
        - json
        - php
      name: output
      in: query
  securitySchemes:
    http:
      type: http
      scheme: bearer
externalDocs:
  description: ''
  url: https://docs.ahrefs.com/docs/api/v3/