# Extract Entities from Text (`text.extract`)

Pull URLs, e-mail addresses, domains, IPv4 addresses, phone-like numbers, hashtags and @mentions out of any text by pattern matching.

- **Route:** `POST /v1/run/text.extract`
- **Price:** $0.0002 per request ($0.20 per 1,000) · `cost_usd` on every response
- **Source:** GetAllAPIs compute (`compute`) · failover: no
- **Measured latency:** p50 4 ms · p95 4 ms · p99 4 ms (1 calls, 30d)
- **Heavy response:** no

## Input

| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
| `text` | string | yes |  | Text to scan |

## Output (`output` in the run envelope)

| Field | Meaning |
|---|---|
| `urls` | http(s) URLs. |
| `emails` | E-mail addresses, lower-cased. |
| `domains` | Host names from the URLs and e-mails. |
| `ipv4_addresses` | Valid IPv4 addresses. |
| `phone_numbers` | Number strings that look like phone numbers (not validated). |
| `hashtags` | #tags. |
| `mentions` | @handles. |
| `counts` | Number of matches per type. |

## Example

```bash
curl -s -X POST https://getallapis.com/v1/run/text.extract \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Ping ops@example.org or call +1 (415) 555-0132. Docs: https://example.org/docs?ref=a #launch @getallapis from 93.184.216.34"}'
```

```python
from getallapis_client import Client
client = Client()  # reads GETALLAPIS_API_KEY
result = client.run('text.extract', {'text': 'Ping ops@example.org or call +1 (415) 555-0132. Docs: https://example.org/docs?ref=a #launch @getallapis from 93.184.216.34'})
print(result['cost_usd'], result['output'])
```

```bash
getallapis run text.extract '{"text":"Ping ops@example.org or call +1 (415) 555-0132. Docs: https://example.org/docs?ref=a #launch @getallapis from 93.184.216.34"}'
```

Quote first (free, validates input): `POST /v1/quote/text.extract` with the same body.
