You need reliable traffic source and engagement data for a domain, and you need it this week. By the end of this article, you’ll know exactly which endpoint returns traffic source and overview metrics, how to call it, how to parse the fields you care about, and how to run the same call from an AI agent via MCP—using one API key from Zyla API Hub.
What this API delivers and when to use it
The Site Traffic API on Zyla API Hub returns domain-level web traffic intelligence: top countries by traffic share, engagement metrics, and an overview that includes a title and description for the site. A companion endpoint provides the supported countries and ISO codes, which is useful when you want to map numeric or alpha country codes into readable labels across your product.
Typical uses:
- Marketing attribution dashboards that need top-5 country shares and engagement metrics.
- Sales lead scoring based on domain traffic patterns and monthly visit estimates.
- Content or SEO tooling that annotates domains with traffic context and basic metadata.
Everything runs under one Zyla account and one API key; you can call any API from the Zyla API Hub catalog (10,000+ APIs) using the same key and a subscription + quota model.
Getting started on Zyla API Hub
Open the Site Traffic API page on Zyla, click Subscribe or Start 7-day trial, and grab your API key. Authentication is a bearer token sent as Authorization: Bearer YOUR_API_KEY. Billing is subscription + quota (not pay-per-call). For the first API, expect a 7-day trial or 50 requests; check the API page for current access options and pricing.
Start here: Start 7-day trial on Site Traffic API. You can always explore more APIs on the Zyla API Hub homepage.
Endpoints you’ll use
1) Traffic Source and Overview
Method: GET
URL: https://zylalabs.com/api/29/site-traffic-api/93/traffic-source-and-overview
What it returns: traffic status per country (top 5), traffic source context, and engagement information for a given domain. Pass the domain without protocol or “www”.
- Required query parameter: domain (example: google.com)
Official cURL:
curl -s -X GET "https://zylalabs.com/api/29/site-traffic-api/1372/countries-list" \
-H "Authorization: Bearer YOUR_API_KEY"
Official example response:
{
"Version": 1,
"SiteName": "google.com",
"Description": "Learn about the Certified Publisher Program. Our publishing software experts will help you maximize revenue and grow your business.",
"TopCountryShares": [
{
"Country": 840,
"CountryCode": "US",
"Value": 0.23679350972974017
},
{
"Country": 392,
"CountryCode": "JP",
"Value": 0.059428140900848324
},
{
"Country": 356,
"CountryCode": "IN",
"Value": 0.05710248670449797
},
{
"Country": 76,
"CountryCode": "BR",
"Value": 0.049777326688909565
},
{
"Country": 826,
"CountryCode": "GB",
"Value": 0.03518837304351638
}
],
"Title": "Google Advanced Search",
"Engagments": {
"BounceRate": "0.28352824215831807",
"Month": "6",
"Year": "2026",
"PagePerVisit": "8.695346223748027",
"Visits": "84940150026",
"TimeOnSite": "605.4395199614316"
},
"EstimatedMonthlyVisits": {
"2026-04-01": 84751050692,…
Fields to pay attention to:
- SiteName, Title, Description: quick metadata you can surface in UI.
- TopCountryShares: top five countries by traffic share. Includes numeric Country, two-letter CountryCode, and fractional Value (share).
- Engagments: engagement metrics for the month and year in the payload, including BounceRate, PagePerVisit, Visits, and TimeOnSite.
- EstimatedMonthlyVisits: date keys (YYYY-MM-01) with visit totals.
2) Countries List
Method: GET
URL: https://zylalabs.com/api/29/site-traffic-api/1372/countries-list
What it returns: a list of supported countries and codes. Useful for mapping the Country and CountryCode values returned by the traffic overview to display-friendly names and regions.
Official cURL:
Official example response:
[{"name":"Afghanistan","alpha-2":"AF","alpha-3":"AFG","country-code":"004","iso_3166-2":"ISO 3166-2:AF","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},{"name":"Åland Islands","alpha-2":"AX","alpha-3":"ALA","country-code":"248","iso_3166-2":"ISO 3166-2:AX","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},{"name":"Albania","alpha-2":"AL","alpha-3":"ALB","country-code":"008","iso_3166-2":"ISO 3166-2:AL","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Algeria","alpha-2":"DZ","alpha-3":"DZA","country-code":"012","iso_3166-2":"ISO 3166-2:DZ","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},{"name":"American Samoa","alpha-2":"AS","alpha-3":"ASM","country-code":"016","iso_3166-2":"ISO 3166-2:AS","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},{"name":"Andorra","alpha-2":"AD","alpha-3":"AND","country-code":"020","iso_3166-2":"ISO 3166-2:AD","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Angola","alpha-2":"AO","alpha-3":"AGO","country-code":"024","iso_3166-2":"ISO 3166-2:AO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},{"name":"Anguilla","alpha-2":"AI","alpha-3":"AIA","country-code":"660","iso_3166-2":"ISO 3166-2:AI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},{"name":"Antarctica","alpha-2":"AQ","alpha-3":"ATA","country-code":"010","iso_3166-2":"ISO 3166-2:AQ","region":"","sub-region":"","intermediate-region":"","region-code":"","sub-region-code":"","intermediate-region-code":""},{"name":"Antigua and Barbuda","alpha-2":"AG","alpha-3":"ATG","country-code":"028","iso_3166-2":"ISO 3166-2:AG","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","s…
Common usage: build a local cache keyed by alpha-2 or country-code to enrich TopCountryShares rows from the traffic overview with country names and regions.
End-to-end example: fetch a domain’s traffic overview and map countries
Below is a minimal Python example that:
- Calls the Traffic Source and Overview endpoint with a domain.
- Calls the Countries List endpoint once and builds a lookup table by alpha-2 code.
- Prints a top-5 country table with readable country names and shares.
import os
import requests
API_KEY = os.getenv("ZYLALABS_API_KEY", "YOUR_API_KEY")
BASE = "https://zylalabs.com/api/29/site-traffic-api"
def get_overview(domain: str):
url = f"{BASE}/93/traffic-source-and-overview"
resp = requests.get(url, params={"domain": domain}, headers={"Authorization": f"Bearer {API_KEY}"})
resp.raise_for_status()
return resp.json()
def get_countries():
url = f"{BASE}/1372/countries-list"
resp = requests.get(url, headers={"Authorization": f"Bearer {API_KEY}"})
resp.raise_for_status()
return resp.json()
def build_country_lookup(countries):
# Map alpha-2 code to country name (e.g., "US" -> "United States of America")
lookup = {}
for c in countries:
alpha2 = c.get("alpha-2")
name = c.get("name")
if alpha2 and name:
lookup[alpha2] = name
return lookup
if __name__ == "__main__":
domain = "google.com"
overview = get_overview(domain)
countries = get_countries()
code_to_name = build_country_lookup(countries)
print(f"Site: {overview.get('SiteName')}")
print(f"Title: {overview.get('Title')}")
print(f"Description: {overview.get('Description')}")
print("\nTop 5 Countries by Share:")
for row in overview.get("TopCountryShares", []):
code = row.get("CountryCode")
share = row.get("Value")
name = code_to_name.get(code, code)
print(f"- {name} ({code}): {share}")
engagements = overview.get("Engagments", {})
print("\nEngagements:")
for k in ["Year", "Month", "Visits", "BounceRate", "PagePerVisit", "TimeOnSite"]:
if k in engagements:
print(f"{k}: {engagements[k]}")
Notes:
- Authorization is via the header Authorization: Bearer YOUR_API_KEY.
- No request body is required for these GET endpoints.
- Consider caching Countries List for 24 hours or more; it changes infrequently and speeds up your flows.
Practical implementation details that save time
- Domain format: pass only the domain, without protocol or “www” (e.g., example.com).
- Data types: several numeric values (e.g., BounceRate, PagePerVisit) arrive as strings; parse as needed in your application logic.
- Traffic shares: TopCountryShares.Value is a fractional share (e.g., 0.23 = 23%). Multiply by 100 for percentages in UI.
- Country mapping: use CountryCode (alpha-2) with Countries List to render display names without hardcoding.
- Caching: Recommended for EstimatedMonthlyVisits and Countries List to reduce latency and stay within your subscription quota.
- Errors: handle non-2xx codes by surfacing a clear message to the user (invalid domain, missing Authorization header, etc.).
Real-world use cases
Lead enrichment inside a CRM
When a new lead includes a website, call the Traffic Source and Overview endpoint to fetch TopCountryShares and display the top markets for that lead’s audience. Combine with Visits and PagePerVisit from Engagments to prioritize outreach.
Attribution dashboards
For each domain you track (e.g., referrals or partners), pull and cache EstimatedMonthlyVisits keyed by month. Use TopCountryShares to break down contributions by geography in stacked bars or choropleth maps.
SEO and content planning
Enrich SERP results or competitor lists with Title and Description for a quick overview, and surface BounceRate or PagePerVisit to highlight opportunities for content improvements.
Calling the API from an AI agent (MCP)
If you’re automating via Claude Code, Cursor, Windsurf, or any MCP-compatible client, you can route calls through Zyla’s MCP gateway. Configure your tool to use the MCP endpoint and provide your API key:
At runtime, your agent can target the same Hub URLs shown above (including the query parameter domain for the Traffic Source and Overview endpoint). Keep the Authorization header as Bearer YOUR_API_KEY, or follow your MCP client’s configuration for passing credentials. Because you’re on a subscription + quota plan, design prompts to reuse cached results instead of re-calling the network on every turn.
Validation checklist before you ship
- Authenticated GET request with Authorization: Bearer YOUR_API_KEY.
- For overview: include domain query parameter, no protocol and no www.
- Parse JSON and cast stringified numeric fields where needed.
- Map TopCountryShares.CountryCode to a readable name via Countries List.
- Cache Countries List and monthly estimates to stay within quota and improve latency.
Frequently asked questions
Does the API accept full URLs or only domains?
Only domains without protocol and without “www” (e.g., example.com) should be passed to the Traffic Source and Overview endpoint.
How do I authenticate?
Send Authorization: Bearer YOUR_API_KEY in the header for every request.
Can I get a list of supported countries?
Yes. Call the Countries List endpoint to receive supported countries and ISO codes that you can use to enrich TopCountryShares from the overview endpoint.
Are the numeric fields numbers or strings?
Some metrics in the Engagments object (e.g., BounceRate, PagePerVisit, Visits, TimeOnSite) are returned as strings. Parse them to numbers in your code if you need to compute or format them.
What are the limits and pricing?
Zyla uses a subscription + quota model (not pay-per-call). For the first API, expect a 7-day trial or 50 requests. Check the API page for current access options and pricing.
Ready to implement? Get your key and start pulling traffic source and engagement data today: Start 7-day trial on Site Traffic API. Explore more categories on the Zyla API Hub when you’re ready to expand your integration.
Official API response
[{"name":"Afghanistan","alpha-2":"AF","alpha-3":"AFG","country-code":"004","iso_3166-2":"ISO 3166-2:AF","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},{"name":"Åland Islands","alpha-2":"AX","alpha-3":"ALA","country-code":"248","iso_3166-2":"ISO 3166-2:AX","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},{"name":"Albania","alpha-2":"AL","alpha-3":"ALB","country-code":"008","iso_3166-2":"ISO 3166-2:AL","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Algeria","alpha-2":"DZ","alpha-3":"DZA","country-code":"012","iso_3166-2":"ISO 3166-2:DZ","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},{"name":"American Samoa","alpha-2":"AS","alpha-3":"ASM","country-code":"016","iso_3166-2":"ISO 3166-2:AS","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},{"name":"Andorra","alpha-2":"AD","alpha-3":"AND","country-code":"020","iso_3166-2":"ISO 3166-2:AD","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Angola","alpha-2":"AO","alpha-3":"AGO","country-code":"024","iso_3166-2":"ISO 3166-2:AO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},{"name":"Anguilla","alpha-2":"AI","alpha-3":"AIA","country-code":"660","iso_3166-2":"ISO 3166-2:AI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},{"name":"Antarctica","alpha-2":"AQ","alpha-3":"ATA","country-code":"010","iso_3166-2":"ISO 3166-2:AQ","region":"","sub-region":"","intermediate-region":"","region-code":"","sub-region-code":"","intermediate-region-code":""},{"name":"Antigua and Barbuda","alpha-2":"AG","alpha-3":"ATG","country-code":"028","iso_3166-2":"ISO 3166-2:AG","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","s…
Official API response
[{"name":"Afghanistan","alpha-2":"AF","alpha-3":"AFG","country-code":"004","iso_3166-2":"ISO 3166-2:AF","region":"Asia","sub-region":"Southern Asia","intermediate-region":"","region-code":"142","sub-region-code":"034","intermediate-region-code":""},{"name":"Åland Islands","alpha-2":"AX","alpha-3":"ALA","country-code":"248","iso_3166-2":"ISO 3166-2:AX","region":"Europe","sub-region":"Northern Europe","intermediate-region":"","region-code":"150","sub-region-code":"154","intermediate-region-code":""},{"name":"Albania","alpha-2":"AL","alpha-3":"ALB","country-code":"008","iso_3166-2":"ISO 3166-2:AL","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Algeria","alpha-2":"DZ","alpha-3":"DZA","country-code":"012","iso_3166-2":"ISO 3166-2:DZ","region":"Africa","sub-region":"Northern Africa","intermediate-region":"","region-code":"002","sub-region-code":"015","intermediate-region-code":""},{"name":"American Samoa","alpha-2":"AS","alpha-3":"ASM","country-code":"016","iso_3166-2":"ISO 3166-2:AS","region":"Oceania","sub-region":"Polynesia","intermediate-region":"","region-code":"009","sub-region-code":"061","intermediate-region-code":""},{"name":"Andorra","alpha-2":"AD","alpha-3":"AND","country-code":"020","iso_3166-2":"ISO 3166-2:AD","region":"Europe","sub-region":"Southern Europe","intermediate-region":"","region-code":"150","sub-region-code":"039","intermediate-region-code":""},{"name":"Angola","alpha-2":"AO","alpha-3":"AGO","country-code":"024","iso_3166-2":"ISO 3166-2:AO","region":"Africa","sub-region":"Sub-Saharan Africa","intermediate-region":"Middle Africa","region-code":"002","sub-region-code":"202","intermediate-region-code":"017"},{"name":"Anguilla","alpha-2":"AI","alpha-3":"AIA","country-code":"660","iso_3166-2":"ISO 3166-2:AI","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","sub-region-code":"419","intermediate-region-code":"029"},{"name":"Antarctica","alpha-2":"AQ","alpha-3":"ATA","country-code":"010","iso_3166-2":"ISO 3166-2:AQ","region":"","sub-region":"","intermediate-region":"","region-code":"","sub-region-code":"","intermediate-region-code":""},{"name":"Antigua and Barbuda","alpha-2":"AG","alpha-3":"ATG","country-code":"028","iso_3166-2":"ISO 3166-2:AG","region":"Americas","sub-region":"Latin America and the Caribbean","intermediate-region":"Caribbean","region-code":"019","s…