Link Extractor API
Extract every link from any web page — filter by internal, external, nofollow, or broken, and export to JSON or CSV.
The Agenty Links API extracts every anchor from any web page along with its anchor text, rel attributes, and (optionally) HTTP status. Filter for internal, external, nofollow, sponsored, ugc, or broken links, then export as JSON or CSV for SEO audits and link-graph analysis.
Features
- All anchorsEvery <a> tag on the page in one call.
- Internal vs externalFilter by same-domain or external links.
- Rel detectionnofollow, sponsored, and ugc flags.
- Broken link checkOptional HEAD requests for status codes.
- Anchor textCaptured per link with surrounding context.
- Position contextDOM position and nearest heading.
- JSON or CSVPick the format that fits your workflow.
- Bulk URLsSubmit many URLs in a single job.
Use cases
- SEO audits of internal linking structure
- Find and fix broken outbound links
- Competitor backlink and partner discovery
- Link mapping during site migrations
- Build a link graph for content recommendation
API examples
curl -X GET "https://api.agenty.ai/v1/links?url=https://example.com" \
-H "Authorization: Bearer YOUR_API_KEY"curl -X POST https://api.agenty.ai/v1/links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"filter": "external",
"checkStatus": true
}'const res = await fetch(
'https://api.agenty.ai/v1/links?url=https://example.com',
{ headers: { 'Authorization': 'Bearer YOUR_API_KEY' } },
);
const { links } = await res.json();
links.forEach((l) => console.log(l.url, l.anchorText));import requests
res = requests.get(
"https://api.agenty.ai/v1/links",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"url": "https://example.com"},
)
for link in res.json()["links"]:
print(link["url"], link["anchorText"])How Agenty compares
| Feature | Agenty | Screaming Frog | Ahrefs | SEMrush |
|---|---|---|---|---|
| Extract all links | Yes (hosted API) | Desktop only | Yes | Yes |
| Broken link checking | Yes | Yes | Yes | Yes |
| nofollow / sponsored / ugc detection | Yes | Yes | Yes | Yes |
| API-first (no desktop app) | Yes | No | Partial | Partial |
| Free tier | Yes | Limited | No | No |
Frequently asked questions
What is the Link Extractor API?
The Agenty Links API extracts every anchor link from any web page. It captures the URL, anchor text, rel attributes (nofollow, sponsored, ugc), and can check HTTP status codes to identify broken links.
Can I filter by link type?
Yes. Use the filter parameter to get only internal, external, nofollow, or broken links. Combine with checkStatus: true to verify link health.
Does it check if links are broken?
Yes. Set checkStatus: true and we perform HEAD requests on every link, flagging 404, 410, and 5xx responses as broken.
Can I export to CSV?
Yes. Add format: "csv" to your request to receive a CSV file with columns for URL, anchor text, rel attributes, status code, and link type.
Is there a free tier?
Yes. All accounts include free credits. Visit our pricing page for details.