Skip to content

Last updated

Changelog

ahrefs.com API

HealthyRead-only

Structured data from ahrefs.com. Generated from ahrefs.com.

Base URL
https://api.maviapi.com/v1/sites/ahrefs
1
Endpoints
58 min ago
Last verified
100%
Uptime / 7d
1611ms
p50 latency
GET/traffic_by_country5 credits per call

Traffic By Country

Monthly organic search traffic of a website by country, with its worldwide rank and total monthly traffic.

Details

Taken from Ahrefs' public website page. Countries come in the page's order (largest traffic first); the public page lists only the top few. share is 0 to 1. A domain Ahrefs has no data for gives an empty countries list and null rank and traffic.

Bearer auth. Pass your key as Authorization: Bearer <key> on every request.
stringOptionalin query

website domain without scheme or www, e.g. trendyol.com

domainstringe.g."trendyol.com"
monthstringe.g."November 2026"
worldwide_rankintegere.g.54
total_trafficintegere.g.70000000
countriesobject[]4 fields
country_codestringe.g."TR"
countrystringe.g."Turkey"
trafficintegere.g.67400000
sharenumbere.g.0.962
paginationobject3 fields
countintegere.g.5
has_morebooleane.g.false
next_cursornull
fetched_atstringe.g."2026-12-02T09:00:27.213Z"
ageintegere.g.0
Try itLive
GET
https://api.maviapi.com/v1/sites/ahrefs/traffic_by_country?domain=trendyol.com
Request
curl "https://api.maviapi.com/v1/sites/ahrefs/traffic_by_country?domain=trendyol.com" \
-H "Authorization: Bearer $MAVI_KEY"
Example390 B
{
  "domain": "trendyol.com",
  "month": "November 2026",
  "worldwide_rank": 54,
  "total_traffic": 70000000,
  "countries": [
    {
      "country_code": "TR",
      "country": "Turkey",
      "traffic": 67400000,
      "share": 0.962
    }
  ],
  "pagination": {
    "count": 5,
    "has_more": false,
    "next_cursor": null
  },
  "fetched_at": "2026-12-02T09:00:27.213Z",
  "age": 0
}

Get all the data, no code

Collect every page of GET /traffic_by_country into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.

Use ahrefs.com API from Claude, ChatGPT and your coding tools

Add this URL as a custom connector and sign in to maviapi. Nothing to install.

How to connect
https://mcp.maviapi.com/mcp

Or run it locally, with each endpoint of ahrefs.com API as its own tool:

claude mcp add maviapi -e MAVIAPI_TOOLS=ahrefs -- npx -y '@maviapi/mcp'

Import ahrefs.com API into Postman and other tools

How to import

Paste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.

  • OpenAPI 3.1
    https://api.maviapi.com/v1/apis/ahrefs/openapi.json
  • Postman
    https://api.maviapi.com/v1/apis/ahrefs/postman.json

The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.

Build with the ahrefs.com API

Choose a starting endpoint

  • Traffic By Country GET /traffic_by_country

    Monthly organic search traffic of a website by country, with its worldwide rank and total monthly traffic.

    Parameters and response fields for GET /traffic_by_country
    Request parameters
    NameType / locationRequiredDescription
    domainstring / queryNowebsite domain without scheme or www, e.g. trendyol.com
    Response fields
    FieldTypeDescription
    domainstring
    monthstring
    worldwide_rankinteger
    total_trafficinteger
    countriesobject[]
    countries[].country_codestring
    countries[].countrystring
    countries[].trafficinteger
    countries[].sharenumber
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger

Export ahrefs.com data to CSV

Each list below downloads as a CSV file with one row per record. Collect it into a dataset with "Get all the data, no code" under the console above. The dataset reads the list page by page, and you download it as CSV, JSON or JSONL.

ListCSV columns
Traffic By CountryGET /traffic_by_countrycountry_code, country, traffic, share

A nested value (a list or an object) is written as JSON in one cell. How datasets and exports work

ahrefs.com API questions

What you get, what it costs and how to call it.

Is there an official ahrefs.com API?

This ahrefs.com API is not official. It is an independent, hosted API from maviapi for the public data on ahrefs.com, and it is not made, endorsed or supported by ahrefs.com. Whether ahrefs.com offers a developer API of its own is a question for ahrefs.com. This one is ready to call with a maviapi key, and every endpoint and field it returns is documented on this page.

What data can I get from the ahrefs.com API?

The ahrefs.com API has one endpoint. It returns JSON with the parameters and fields documented above:

  • GET /traffic_by_country: Monthly organic search traffic of a website by country, with its worldwide rank and total monthly traffic.

How much does the ahrefs.com API cost?

Calls are paid in credits from your maviapi plan, and only successful calls are charged. Every endpoint of this API costs 5 credits per call. On the Basic plan ($19 a month for 25,000 credits), 1,000 calls cost about $3.80. Failed calls are free. The Free plan gives you 1,000 credits a month, with no credit card required. See plans and credit prices for everything after that.

How do I call the ahrefs.com API?

Send an HTTPS request to the endpoint with your API key in the Authorization header. For example, GET /traffic_by_country:

cURL
curl 'https://api.maviapi.com/v1/sites/ahrefs/traffic_by_country' \
  -H "Authorization: Bearer $MAVI_KEY"

Create a key on your API keys page, or try any endpoint first in the console above with the free test key.

What are the ways to get ahrefs.com data as JSON?

Each way to get ahrefs.com data as JSON fits a different need:

  • Your own scraper: Full control and no vendor, but the parsing, the blocked requests and the repairs after every change on ahrefs.com are yours. Better for a one-off pull from a page that rarely changes.
  • Apify: A marketplace of Actors you run, where input, output and price are set by each Actor. Better when an Actor already returns what you need, or you want to host your own code. See maviapi vs Apify.
  • RapidAPI: A hub of APIs added by many providers, called with one RapidAPI key and priced per API. Better when you already use the hub and one of its APIs covers what you need. Source: RapidAPI docs.
  • maviapi: The ahrefs.com API on this page: one documented endpoint, a published response schema and one key for the whole catalog. Better when this data is part of your product and you do not want to maintain a scraper.

What happens when ahrefs.com changes its layout?

Your code does not change. maviapi keeps the ahrefs.com API working when ahrefs.com changes its pages, so you keep calling the same endpoints and get JSON in the shape documented here. See its current health on the status page and what changed in its changelog.

Will an update break my ahrefs.com API integration?

No. An endpoint you use never changes shape: new fields, optional parameters and endpoints are added beside it, and a change that would break a call ships as a new endpoint. Ignore response fields you do not know, and follow the changelog for what is new.

  • Tripadvisor API

    Trip-planning data from Tripadvisor: geo search plus attractions, restaurants and hotels by location (geo_id), with…

  • Eventbrite API

    Events listed on Eventbrite for a city and date range: dates, venue with address and coordinates, image and summary…

  • Songkick Concerts API

    Upcoming concerts and music festivals in any city from Songkick, for a date window, with venues, performers, prices…