Extracts all numeric values from any text string, returning them as an array. Use via MCP in Cursor or Windsurf for parsing invoices, logs, or user input, or call GET /v1/string/extract-numbers directly. Finds integers, decimals, and negative numbers while ignoring text. Perfect for AI agents processing mixed content where reliable number extraction beats regex guesswork.
curl "https://tinyfn.io/v1/string/extract-numbers" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/extract-numbers', {
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-numbers',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
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"
}
}
}
}
Call the extract_numbers tool with your text string. It returns an array of all numeric values found, preserving decimals and negatives.
Detects integers (42), decimals (3.14), negative numbers (-15), and scientific notation (1e6). Ignores currency symbols and separators.
Returns numbers as parsed numeric values, not strings. So '3.14' becomes 3.14, and '042' becomes 42.
Yes, it processes any text input. Useful for parsing logs, configuration files, or mixed content where numbers are embedded in text.
Returns an empty array. The function never fails - it always returns a valid array structure.
Get your free API key and start using Extract Numbers in seconds.
Get Free API Key