extract
Link Extractor
Extract all hyperlinks and anchor attributes from raw HTML with an API-ready link extractor.
1 credit / run
Playground
About this tool
Link extractor API helps you pull every hyperlink from raw HTML in a single request. Use this link extractor to analyze page navigation, audit outbound links, or build SEO tools. It scans for anchor tags, captures their href, text content, rel, and target attributes, and returns a clean array for link analysis or content mapping. Send any HTML string and the link extractor identifies all anchor elements using a robust parsing engine. Whether you are auditing internal links, checking for nofollow attributes, or cataloging external references, this tool gives you structured link data without manual DOM traversal. The link extractor returns each hyperlink with its destination URL, anchor text, rel attribute, and target setting. Use this data to verify link structures, identify broken references, or analyze anchor text distribution. The structured output makes it easy to filter links by attribute or domain. Common use cases include SEO audits, content migration, and competitive analysis. Developers embed this link extractor in automation scripts to map site navigation or validate link integrity. Content teams use it to ensure proper link attribution. The API returns results instantly, suitable for real-time processing or batch analysis. To extract links from a live webpage, first fetch the HTML using your preferred method, then pass the raw HTML to this endpoint. The API accepts POST requests with a JSON body containing your HTML. The response includes an array of link objects. Empty pages return an empty array. This link extractor works well alongside extract-images-from-html and extract-meta-from-html for complete page analysis. For extracting URLs from plain text instead of HTML, use extract-urls-from-text.
Inputs
Name
Type
Required
Description
Outputs
Name
Type
Description
links
array
Array of link objects with href, text, rel, and target.
links[].href
string
Link destination URL from the href attribute.
links[].text
string
Anchor text content of the link.
links[].rel
string
Rel attribute value (e.g., nofollow, noopener).
links[].target
string
Target attribute value (e.g., _blank).
Examples
Request
{ "html": "<nav><a href=\"/home\">Home</a><a href=\"/about\" target=\"_blank\">About</a><a href=\"https://external.com\" rel=\"nofollow\">External</a></nav>" }
Response
{ "links": [ { "href": "/home", "text": "Home" }, { "href": "/about", "text": "About", "target": "_blank" }, { "href": "https://external.com", "text": "External", "rel": "nofollow" } ] }
Frequently Asked Questions
What does the link extractor return?
An array of link objects with href URL, anchor text, rel attribute, and target attribute when present.
Can I extract links from a live URL?
Fetch the page HTML first using your preferred method, then pass the raw HTML to this API.
Does it capture rel and target attributes?
Yes, the link extractor captures rel (nofollow, noopener, etc.) and target (_blank, etc.) attributes.
How do I call the link extractor API?
POST to /api/run/extract-links-from-html with a JSON body containing your html field.
What about links in plain text?
For extracting URLs from plain text, use extract-urls-from-text instead.
Changelog
2025-01-05
Initial tool release.
Similar Tools
Browse additional tools within this category that solve related problems. Each tool is designed to handle a specific task, but they work best when combined. Use multiple endpoints together to create efficient data processing pipelines, automate repetitive tasks, or build complete solutions tailored to your needs."
extract
Image Extractor
Extract all image tags and attributes from raw HTML with an API-ready image extractor.
1 credit / run
View Tool
->
extract
HTML Form Parser
Parse and extract all forms and input fields from HTML with an API-ready form parser.
1 credit / run
View Tool
->
extract
Email Extractor
Extract all email addresses from any text with a fast, API-ready email extractor.
1 credit / run
View Tool
->
Top quality, fair pricing
Start free, then unlock premium tools and higher limits when you’re ready.
Guest
$0Forever
For quick tests and light usage.
- Privacy first
- Access to basic tools
- Strict rate limits applied
- No API keys needed
- No support
Paid
$79/ month
For production apps and premium tools.
- Privacy first
- Access to basic tools
- Access to premium tools
- Access to AI tools
- Higher rate limits
- Priority support
- Usage insights
- 250,000 credits per month
Enterprise
Custom
For teams needing custom limits, security, and SLAs.
- Privacy first
- Full access to tools
- Custom limits
- SLA
- Dedicated support
- Team onboarding
- Security review
- Real‑time streaming responses
Technical & Professional Built for Divhunt. Available for Enterprise.
Skip building infrastructure. Use the same battle-tested APIs that power Divhunt V2.
Get in Touch
Built in Divhunt
We use cookies.
By clicking “Accept All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View ourCookie Policyfor more information.
Optahunt
Preferences
Manage your cookie preferences.
Essentials
Always Active
These are required for the website to work, like remembering your privacy settings, keeping you logged in, or enabling secure payments.
Performance
These help us understand how people use our site (like which pages are most popular) so we can make improvements.
Personalization
These allow the site to remember your preferences (such as language or region) and provide enhanced features.
Advertising & Targeting
These are used to deliver ads more relevant to you, limit how often you see them, and measure campaign performance.
Save my preferences
You can always change these settings later via ourCookie Policy pagepage, or via the cookie widget placed at the bottom left of the page.