String Utilities

Extract Urls

Extracts all URLs from any text input using robust pattern matching. Available via MCP in Cursor and other AI editors, or REST API at /v1/string/extract-urls. Feed it a blog post, email, or code snippet — get back a clean array of URLs. Perfect for content analysis, link validation, or cleaning up scraped data.

API Endpoint

GET /v1/string/extract-urls

Code Examples

curl "https://tinyfn.io/v1/string/extract-urls" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/extract-urls', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/string/extract-urls',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:

{
  "mcpServers": {
    "tinyfn-string": {
      "url": "https://tinyfn.io/mcp/string",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What URL formats does the extract-urls tool recognize?

Detects http://, https://, ftp://, and protocol-relative URLs (//example.com). Also finds bare domains and www. prefixed URLs in most contexts.

How do I use extract-urls with MCP in Cursor or Claude Code?

Simply paste your text and the MCP tool will return a JSON array of found URLs. Great for analyzing documentation, extracting links from research, or validating references in code comments.

Does extract-urls handle malformed or partial URLs?

It's designed for well-formed URLs. Partial URLs like 'example.com/path' without protocol may be missed depending on context. Always validate extracted URLs for your specific use case.

Can I extract URLs from HTML or markdown content?

Yes, it works with any text format including HTML, markdown, plain text, or code. It extracts the actual URL strings regardless of surrounding markup or syntax.

What's the difference between this and regex URL extraction?

Uses optimized patterns that handle edge cases better than simple regex. Catches URLs in various contexts while avoiding false positives from similar-looking strings.

Try Extract Urls Now

Get your free API key and start using Extract Urls in seconds.

Get Free API Key