Most "SEO agent" stacks end up doing the same three things by hand: fetching a page, parsing HTML with a throwaway script, and then re-fetching dozens of URLs to see which ones still resolve. That works until you need it on a schedule, in a pipeline, or inside a tool-using model that should not be writing regex against raw HTML.
Four REST endpoints are live for exactly that job: page link analysis, broken-link checking, keyword density analysis, and sitemap generation. They run on the same agent key you already use for the rest of the API, they work anonymously inside a free daily allowance, and every successful response includes a billing block so your agent knows what it spent.
All four are POST endpoints that take a url, fetch the page server-side, and return JSON. Nothing here needs a browser session, a headless runner on your machine, or a signed-in dashboard.
| Endpoint | Returns | Cost after free daily | Free daily |
|---|---|---|---|
/api/agent/links/analyze | Page metadata plus up to 500 resolved links with internal/external/nofollow counts | 1 credit | 3 calls |
/api/agent/links/check | HTTP status for up to 200 links, checked 10 at a time | 1 credit per 25 links | 1 call |
/api/agent/seo/keywords | Top unigrams with density, plus the 20 strongest bigrams | 3 credits | 3 calls |
/api/agent/sitemap/generate | Crawled same-domain page list and a ready-to-serve XML sitemap | 1 credit per 10 pages | 1 call |
The free daily allowance is tracked per tool, per caller. Identity is resolved in this order: an API key on the request, then a signed-in user, then the requesting IP address. Paid plans raise each of these daily allowances substantially — see pricing for current plan details. Once the allowance is exhausted, the same request spends flexible credits instead, and if there are neither free calls nor credits left you get a 402 with a billing object explaining the shortfall rather than a vague error.
Start with /api/agent/links/analyze. It is the cheap reconnaissance call: one fetch, and you learn what the page is and what it points at.
curl -s -X POST https://agentmediatools.com/api/agent/links/analyze \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AMT_KEY" \
-d '{"url":"https://agentmediatools.com/"}'
A real response from that call (trimmed here) looks like this:
{
"success": true,
"url": "https://agentmediatools.com/",
"status": 200,
"elapsed_ms": 401,
"page": {
"title": "Agent Media Tools — Free Image, PDF, Pastebin & Agent APIs",
"description": "Agent Media Tools — free image resize, PDF, pastebin, QR code & agent APIs…",
"canonical": "https://agentmediatools.com/",
"h1_count": 1,
"h2_count": 15,
"word_count": 5078
},
"links": { "total": 60, "internal": 59, "external": 1, "nofollow": 0, "noopener": 1 },
"entries": [
{
"url": "https://agentmediatools.com/",
"text": "Agent Media Tools",
"rel": null, "target": null,
"is_internal": true, "is_external": false,
"protocol": "https:", "pathname": "/"
}
],
"billing": { "tool": "link-analyzer", "free": true, "free_used": 1, "free_daily_limit": 3, "free_remaining": 2, "credit_cost_if_over": 1, "plan": "free" }
}
Useful details your agent gets for free here: the page title, meta description, canonical tag, H1/H2 counts, and a word count. Link entries carry the anchor text, rel, target, protocol and pathname, with is_internal / is_external already resolved against the final hostname. Fragment-only links and javascript: links are dropped, and duplicates are collapsed, so links.total is a de-duplicated count rather than a raw tag count.
/api/agent/links/check takes the same page and actually requests up to 200 of its links, ten concurrently, with an 8-second timeout on each.
curl -s -X POST https://agentmediatools.com/api/agent/links/check \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AMT_KEY" \
-d '{"url":"https://agentmediatools.com/","max_links":5}'
{
"success": true,
"page_url": "https://agentmediatools.com/",
"page_status": 200,
"elapsed_ms": 345,
"summary": { "total_checked": 5, "broken": 0, "valid": 5, "total_on_page": 5, "limit_capped": true },
"results": [
{ "url": "https://agentmediatools.com/tools", "text": "All tools", "status": 200,
"status_text": "OK", "redirect": null, "broken": false, "elapsed_ms": 71 }
],
"billing": { "tool": "broken-link-checker", "free": true, "free_used": 1, "free_daily_limit": 1, "free_remaining": 0, "credit_cost_if_over": 1, "plan": "free" }
}
Three fields to wire into your loop. max_links defaults to 50 and is clamped between 1 and 200. limit_capped: true means the crawler stopped at your cap and there were more links on the page than you asked about — always check it before reporting "0 broken links" as a clean bill of health, because it might just mean you only looked at the first 50. And broken is set for any status of 400 or above, plus DNS failures and timeouts, so results mixes HTTP statuses with error strings on purpose.
Because cost scales with scope, a 50-link sweep costs 2 credits and a 200-link sweep costs 8. If you are auditing a large site, run links/analyze first, then call links/check only on the pages whose internal links actually changed.
curl -s -X POST https://agentmediatools.com/api/agent/seo/keywords \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AMT_KEY" \
-d '{"url":"https://agentmediatools.com/","min_length":3,"max_keywords":10}'
The response gives you a page block (title, first H1, meta description, headings, total_words) plus a keywords array sorted by frequency. Each entry has word, count, occurrences, and density as a percentage of all non-stopword words — for example {"word":"api","count":46,"density":"1.231%"}. A separate bigrams array returns the 20 most frequent two-word phrases, which is usually the fastest way to see whether a page is really about the topic you think it targets.
Two honest notes about what this is measuring. First, it tokenizes the page's visible text plus inline scripts and styles, so on JavaScript-heavy pages you may see utility words like const or style near the top of the list. It is a comparative signal across your own pages, not a replacement for a search console. Second, min_length defaults to 3 and max_keywords defaults to 100 and is clamped between 10 and 500; numeric-only tokens and a built-in English stop-word list are filtered out before ranking.
curl -s -X POST https://agentmediatools.com/api/agent/sitemap/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AMT_KEY" \
-d '{"url":"https://agentmediatools.com/","max_pages":5}'
{
"success": true,
"domain": "agentmediatools.com",
"summary": { "pages_crawled": 5, "pages_discovered": 5, "limit_reached": true },
"pages": [ { "url": "https://agentmediatools.com", "title": "Agent Media Tools — …",
"lastmod": null, "priority": "1.0", "change_freq": "daily" } ],
"sitemap_xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">…",
"sitemap_size_bytes": 760
}
This is a breadth-first same-domain crawl. max_pages defaults to 50 and is clamped between 5 and 500, and it bills 1 credit per 10 pages once the free daily calls are used. The crawler stays on the starting hostname, ignores #, javascript: and mailto: hrefs, and skips common asset extensions such as .pdf, .zip, .png, .jpg, .css, .js, .mp4 and font files, so the result is pages rather than downloads.
sitemap_xml is the finished document, ready to write straight to sitemap.xml. Two details worth knowing before you deploy it: the homepage gets priority 1.0 / changefreq daily and every other page gets 0.8 / weekly, and lastmod is currently always null because the crawler does not read Last-Modified headers. If real modification dates matter to you, patch them in before publishing.
No client library is required — plain requests against the same four routes:
import os, requests
BASE = "https://agentmediatools.com"
KEY = os.environ["AMT_KEY"]
headers = {"Authorization": f"Bearer {KEY}"}
def audit(site: str):
analyze = requests.post(f"{BASE}/api/agent/links/analyze",
json={"url": site}, headers=headers, timeout=60).json()
print("links:", analyze["links"])
sweep = requests.post(f"{BASE}/api/agent/links/check",
json={"url": site, "max_links": 25}, headers=headers, timeout=120).json()
print("checked:", sweep["summary"])
kw = requests.post(f"{BASE}/api/agent/seo/keywords",
json={"url": site, "max_keywords": 25}, headers=headers, timeout=60).json()
print("top keyword:", kw["keywords"][0])
site_map = requests.post(f"{BASE}/api/agent/sitemap/generate",
json={"url": site, "max_pages": 50}, headers=headers, timeout=300).json()
open("sitemap.xml", "w").write(site_map["sitemap_xml"])
print("pages:", site_map["summary"])
audit("https://example.com")
Every successful response carries a billing object, so an agent can log spend per step without guessing: free, free_used, free_remaining, credit_cost_if_over and plan are all in the payload. Error responses omit it (except quota rejections, which include a billing block explaining the shortfall). Wire that into your own accounting and a weekly audit run becomes measurable instead of mysterious.
On cost: each endpoint spends credits only after its free daily calls are used. Sitemap generation is 1 credit per 10 pages crawled, so the 50-page default is 5 credits, and the sweeps in step two scale the same way.
200 with "success": false and an error string. Always check success, not just the transport status.url is required. Missing it returns a 400 with "error": "url required"; a non-HTML target returns success: false with "URL does not point to an HTML page".None of this replaces a full crawler with a rendering engine. It replaces the throwaway scripts you would otherwise write to answer four specific questions quickly — how many links does this page have, are any of them dead, what is it actually about, and what should go in the sitemap — with calls an agent can make deterministically and cheaply.
Create an agent key to raise the daily allowance and spend flexible credits, or start with anonymous free calls today. REST only — no MCP tool wraps these four routes.
Get an agent key