Ahrefs MCP API

The MCP API from Ahrefs — 7 operation(s) for mcp.

GitHub OpenAPI

Operations 7

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /projects List my projects · Projects #
Ask an LLM
“Which projects do I have access to in Ahrefs?”
“Can I list only the projects I own?”
Tell an agent
List my projects.
List projects with access {access}.
GET /project-keywords List keywords in a Rank Tracker project · Keywords #
Ask an LLM
“What keywords are tracked in one of my Rank Tracker projects?”
“Can I export the keywords of a Rank Tracker project?”
Tell an agent
List keywords in project {project_id}.
Export Rank Tracker project {project_id} keywords.
GET /keyword-list-keywords List keywords in a keyword list · Keywords list #
Ask an LLM
“Which keywords are in a keyword list?”
“Can I get the keywords from a keyword list by its ID?”
Tell an agent
List keywords in keyword list {keyword_list_id}.
Export keyword list {keyword_list_id}.
GET /project-competitors List competitors of a Rank Tracker project · Competitors #
Ask an LLM
“Who are the competitors of my Rank Tracker project?”
“Can I get a competitor list for a Rank Tracker project?”
Tell an agent
List competitors of project {project_id}.
Export competitor list for Rank Tracker project {project_id}.
GET /locations List available locations and languages · Locations and languages #
Ask an LLM
“Which countries and languages can I target for keyword tracking?”
“What location codes are available for a country?”
Tell an agent
List locations in {country_code}.
List locations in {country_code} for state {us_state}.
GET /brand-radar-prompts List Brand Radar prompts · Brand Radar prompts #
Ask an LLM
“What prompts does Brand Radar use for a report?”
“Can I see the Brand Radar prompts for a report?”
Tell an agent
List Brand Radar prompts for report {report_id}.
Show the Brand Radar prompts in report {report_id}.
GET /brand-radar-reports List Brand Radar reports · Brand Radar Reports #
Ask an LLM
“Which Brand Radar reports have I created?”
“Can I list all my Brand Radar reports?”
Tell an agent
List my Brand Radar reports.
Show all Brand Radar reports.

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:ahrefs-mcp-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

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

OpenAPI Specification

ahrefs-mcp-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Management MCP API
  description: Project management.
  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/management
  description: Ahrefs Management
security:
- http:
  - read
tags:
- name: MCP
paths:
  /projects:
    get:
      tags:
      - MCP
      summary: Projects
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: projects
      parameters:
      - description: The access type of the project.
        required: false
        explode: false
        schema:
          type: string
          enum:
          - private
          - shared
        name: access
        in: query
      - description: The email of the project owner
        required: false
        explode: false
        schema:
          type: string
        name: owned_by
        in: query
      - description: 'The unique identifier of the project. You can find it in the URL of your Rank Tracker project in Ahrefs: `https://app.ahrefs.com/rank-tracker/overview/#project_id#`'
        required: false
        explode: false
        schema:
          type: integer
        name: project_id
        in: query
      - description: Has Rank Tracker keywords.
        required: false
        explode: false
        schema:
          type: boolean
        name: has_keywords
        in: query
      - $ref: '#/components/parameters/output'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/projects'
            application/xml:
              schema:
                $ref: '#/components/schemas/projects'
        '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'
  /project-keywords:
    get:
      tags:
      - MCP
      summary: Keywords
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: project-keywords
      parameters:
      - description: 'The unique identifier of the project. You can find it in the URL of your Rank Tracker project in Ahrefs: `https://app.ahrefs.com/rank-tracker/overview/#project_id#`'
        required: true
        explode: false
        schema:
          type: integer
        name: project_id
        in: query
      - $ref: '#/components/parameters/output_json_php_xml'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/project-keywords'
            application/xml:
              schema:
                $ref: '#/components/schemas/project-keywords'
        '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'
  /keyword-list-keywords:
    get:
      tags:
      - MCP
      summary: Keywords list
      description: '**Requests to this endpoint are free and do not consume any API units.**'
      operationId: keyword-list-keywords
      parameters:
      - description: The id of an existing keyword list.
        required: true
        explode: false
        schema:
          type: integer
        name: keyword_list_id
        in: query
      - $ref: '#/components/parameters/output'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/keyword-list-keywords'
            application/xml:
              schema:
                $ref: '#/components/schemas/keyword-list-keywords'
        '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'
  /project-competitors:
    get:
      tags:
      - MCP
      summary: Competitors
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: project-competitors
      parameters:
      - description: 'The unique identifier of the project. You can find it in the URL of your Rank Tracker project in Ahrefs: `https://app.ahrefs.com/rank-tracker/overview/#project_id#`'
        required: true
        explode: false
        schema:
          type: integer
        name: project_id
        in: query
      - $ref: '#/components/parameters/output'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/project-competitors'
            application/xml:
              schema:
                $ref: '#/components/schemas/project-competitors'
        '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'
  /locations:
    get:
      tags:
      - MCP
      summary: Locations and languages
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: locations
      parameters:
      - description: A two-letter country code (ISO 3166-1 alpha-2).
        required: true
        explode: false
        schema:
          type: string
          enum:
          - ad
          - ae
          - af
          - ag
          - ai
          - al
          - am
          - ao
          - ar
          - as
          - at
          - au
          - aw
          - az
          - ba
          - bb
          - bd
          - be
          - bf
          - bg
          - bh
          - bi
          - bj
          - bn
          - bo
          - br
          - bs
          - bt
          - bw
          - by
          - bz
          - ca
          - cd
          - cf
          - cg
          - ch
          - ci
          - ck
          - cl
          - cm
          - cn
          - co
          - cr
          - cu
          - cv
          - cy
          - cz
          - de
          - dj
          - dk
          - dm
          - do
          - dz
          - ec
          - ee
          - eg
          - es
          - et
          - fi
          - fj
          - fm
          - fo
          - fr
          - ga
          - gb
          - gd
          - ge
          - gf
          - gg
          - gh
          - gi
          - gl
          - gm
          - gn
          - gp
          - gq
          - gr
          - gt
          - gu
          - gy
          - hk
          - hn
          - hr
          - ht
          - hu
          - id
          - ie
          - il
          - im
          - in
          - iq
          - is
          - it
          - je
          - jm
          - jo
          - jp
          - ke
          - kg
          - kh
          - ki
          - kn
          - kr
          - kw
          - ky
          - kz
          - la
          - lb
          - lc
          - li
          - lk
          - ls
          - lt
          - lu
          - lv
          - ly
          - ma
          - mc
          - md
          - me
          - mg
          - mk
          - ml
          - mm
          - mn
          - mq
          - mr
          - ms
          - mt
          - mu
          - mv
          - mw
          - mx
          - my
          - mz
          - na
          - nc
          - ne
          - ng
          - ni
          - nl
          - 'no'
          - np
          - nr
          - nu
          - nz
          - om
          - pa
          - pe
          - pf
          - pg
          - ph
          - pk
          - pl
          - pn
          - pr
          - ps
          - pt
          - py
          - qa
          - re
          - ro
          - rs
          - ru
          - rw
          - sa
          - sb
          - sc
          - se
          - sg
          - sh
          - si
          - sk
          - sl
          - sm
          - sn
          - so
          - sr
          - st
          - sv
          - td
          - tg
          - th
          - tj
          - tk
          - tl
          - tm
          - tn
          - to
          - tr
          - tt
          - tw
          - tz
          - ua
          - ug
          - us
          - uy
          - uz
          - vc
          - ve
          - vg
          - vi
          - vn
          - vu
          - ws
          - ye
          - yt
          - za
          - zm
          - zw
        name: country_code
        in: query
      - description: A two-letter US state code (ISO 3166-2:US). Required only if `country_code` is set to `us`
        required: false
        explode: false
        schema:
          type: string
          enum:
          - al
          - ak
          - az
          - ar
          - ca
          - co
          - ct
          - de
          - dc
          - fl
          - ga
          - hi
          - id
          - il
          - in
          - ia
          - ks
          - ky
          - la
          - me
          - md
          - ma
          - mi
          - mn
          - ms
          - mo
          - mt
          - ne
          - nv
          - nh
          - nj
          - nm
          - ny
          - nc
          - nd
          - oh
          - ok
          - or
          - pa
          - ri
          - sc
          - sd
          - tn
          - tx
          - ut
          - va
          - wa
          - wv
          - wi
          - wy
        name: us_state
        in: query
      - $ref: '#/components/parameters/output_json_php'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/locations'
            application/xml:
              schema:
                $ref: '#/components/schemas/locations'
        '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'
  /brand-radar-prompts:
    get:
      tags:
      - MCP
      summary: Brand Radar prompts
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: brand-radar-prompts
      parameters:
      - description: 'The ID of the report to use. You can find it in the URL of your Brand Radar report in Ahrefs: `https://app.ahrefs.com/brand-radar/reports/#report_id#/...`'
        required: true
        explode: false
        schema:
          type: string
        name: report_id
        in: query
      - $ref: '#/components/parameters/output'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/brand-radar-prompts'
            application/xml:
              schema:
                $ref: '#/components/schemas/brand-radar-prompts'
        '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'
  /brand-radar-reports:
    get:
      tags:
      - MCP
      summary: Brand Radar Reports
      description: '>Requests to this endpoint are free and do not consume any API units.'
      operationId: brand-radar-reports
      parameters:
      - $ref: '#/components/parameters/output_json_php'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/brand-radar-reports'
            application/xml:
              schema:
                $ref: '#/components/schemas/brand-radar-reports'
        '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:
  parameters:
    output:
      description: The output format.
      required: false
      explode: false
      schema:
        type: string
        enum:
        - json
        - csv
        - xml
        - php
      name: output
      in: query
    output_json_php:
      description: The output format.
      required: false
      explode: false
      schema:
        type: string
        enum:
        - json
        - php
      name: output
      in: query
    output_json_php_xml:
      description: The output format.
      required: false
      explode: false
      schema:
        type: string
        enum:
        - json
        - php
        - xml
      name: output
      in: query
  schemas:
    project-competitors:
      properties:
        competitors:
          items:
            properties:
              mode:
                type: string
                title: mode
                description: 'The scope of the target. Possible values: `exact`, `prefix`, `domain`, `subdomains`.'
              url:
                type: string
                format: url
                title: url
                description: The URL of the project's target.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
    brand-radar-prompts:
      properties:
        prompts:
          items:
            properties:
              country:
                type: string
                title: country
                description: The country of the prompt.
              created_at:
                type: string
                format: date
                title: created_at
                description: The date the prompt was created.
              prompt:
                type: string
                title: prompt
                description: The text of the prompt.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
    projects:
      properties:
        projects:
          items:
            properties:
              access:
                type: string
                title: access
                description: 'The access level of the project. Possible values: `private`, `shared`.'
              folder:
                properties:
                  id:
                    type: integer
                  name:
                    type:
                    - string
                    - 'null'
                type:
                - object
                - 'null'
                title: folder
                description: Innermost folder that the project is in.
              keyword_count:
                type: integer
                title: keyword_count
                description: The number of keywords in the project.
              mode:
                type: string
                title: mode
                description: 'The scope of the target. Possible values: `exact`, `prefix`, `domain`, `subdomains`.'
              owned_by:
                type:
                - string
                - 'null'
                title: owned_by
                description: The email of the project owner.
              project_id:
                type: string
                title: project_id
                description: 'The unique identifier of the project. You can find it in the URL of your Rank Tracker project in Ahrefs: `https://app.ahrefs.com/rank-tracker/overview/#project_id#`.'
              project_name:
                type: string
                title: project_name
                description: The project name.
              protocol:
                type: string
                title: protocol
                description: 'The protocol of the target. Possible values: `both`, `http`, `https`.'
              url:
                type: string
                format: url
                title: url
                description: The URL of the project's target.
              verified:
                type: boolean
                title: verified
                description: Whether the project is verified.
              web_analytics_data_key:
                type: string
                title: web_analytics_data_key
                description: Web Analytics Data Key.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
    keyword-list-keywords:
      properties:
        keywords:
          items:
            properties:
              keyword:
                type: string
                title: keyword
                description: The keyword added to the project.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
    locations:
      properties:
        location:
          properties:
            country_code:
              type: string
              title: country_code
              description: The country code of the location.
            languages:
              items:
                items: false
                prefixItems:
                - type: string
                - type: string
                type: array
                maxItems: 2
                minItems: 2
              type: array
              title: languages
              description: A list of language codes and names for the specified country code.
            locations:
              items:
                items: false
                prefixItems:
                - type: integer
                - type: string
                type: array
                maxItems: 2
                minItems: 2
              type: array
              title: locations
              description: A list of location IDs and names for the specified country code.
          type: object
      type: object
      xml:
        name: AhrefsApiResponse
    brand-radar-reports:
      properties:
        reports:
          items:
            properties:
              created_at:
                type: string
                format: date
                title: created_at
                description: The date the report was created.
              project_id:
                type:
                - integer
                - 'null'
                title: project_id
                description: The ID of the project the report is linked to.
              prompts_frequency:
                items:
                  properties:
                    data_source:
                      type: string
                    frequency:
                      type: string
                  type: object
                type: array
                title: prompts_frequency
                description: 'A record with fields `data_source` (possible values: `chatgpt`, `copilot`, `gemini`, `google_ai_mode`, `claude`, `google_ai_overviews`, `grok`, `perplexity`) and `frequency` (possible values: `daily`, `weekly`, `monthly`, `off`).'
              report_id:
                type: string
                title: report_id
                description: The unique identifier of the report.
              report_name:
                type: string
                title: report_name
                description: The name of the report.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
    Error_response:
      properties:
        error:
          type: string
      type: object
      xml:
        name: AhrefsApiResponse
    project-keywords:
      properties:
        keywords:
          items:
            properties:
              keyword:
                type: string
                title: keyword
                description: The keyword added to the project.
              language:
                type: string
                title: language
                description: The name of the language assigned to a given keyword.
              language_code:
                type: string
                title: language_code
                description: The code of the language assigned to a given keyword.
              location:
                type: string
                title: location
                description: The name of the location assigned to a given keyword.
              location_id:
                type: integer
                title: location_id
                description: The ID of the location assigned to a given keyword.
              tags:
                items:
                  type: string
                type: array
                title: tags
                description: A list of tags assigned to a given keyword.
            type: object
          type: array
      type: object
      xml:
        name: AhrefsApiResponse
  responses:
    error_403:
      description: Forbidden
      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'
    error_400:
      description: Bad Request
      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_500:
      description: Internal Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error_response'
        application/xml:
          schema:
            $ref: '#/components/schemas/Error_response'
  securitySchemes:
    http:
      type: http
      scheme: bearer
externalDocs:
  description: ''
  url: https://docs.ahrefs.com/docs/api/v3/