Skip to content
POST AI agent ready /v1/text/extract-urls

URL Extractor API - Find All Links in Any Text

Scans a text string and returns all detected URLs. Matches http://, https://, and protocol-relative URLs. Returns a deduplicated list with the count.

Parameters

stringrequired

The text to scan for URLs.

Code examples

curl -X POST https://api.botoi.com/v1/text/extract-urls \
  -H "Content-Type: application/json" \
  -d '{"text":"Visit https://botoi.com for APIs. Docs at https://api.botoi.com/docs."}'

When to use this API

Build a link preview feature

Extract URLs from user-submitted messages to generate rich link previews with titles, images, and descriptions.

Audit outbound links in documentation

Scan documentation pages for all external URLs and check them against an allowlist or run link-checking.

Frequently asked questions

Are duplicate URLs returned?
No. The response contains only unique URLs, even if the same URL appears multiple times in the input.
Does this detect URLs without a protocol (like example.com)?
The API matches URLs starting with http://, https://, or //. Bare domains without a protocol are not matched to avoid false positives.
Are query strings and fragments included?
Yes. Full URLs including query parameters (?key=value) and hash fragments (#section) are captured.
Can I extract URLs from HTML content?
This endpoint extracts URLs from plain text. For HTML, consider using the /v1/html-to-text/convert endpoint first, then extracting URLs from the result.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.