# Tor Network API
> Look up the live Tor network as an API — powered by the Tor Project's official Onionoo service and the canonical bulk exit-node list. Check whether any IPv4 or IPv6 address is a Tor relay (is_tor_relay) and whether it is an exit node that clients leave the network through (is_exit_node, corroborated against the bulk exit list), returning the full matching relay record(s): nickname, fingerprint, flags, country, autonomous system, advertised bandwidth, exit-policy summary and first/last-seen dates. Or search the public relay list by nickname, fingerprint, IP, country or flag (Exit, Guard, Fast, Stable…) with paging. Built for fraud and abuse triage, login-risk scoring, comment- and registration-filtering, and network research — knowing at a glance whether a connection originates from the Tor network. Range data is fetched live from the Tor Project, so it is always current. A Tor-network lookup — distinct from cloud/CDN attribution (cloudips), IP geolocation (ipgeo), ASN/BGP ownership (asn, ripestat) and open-port exposure (internetdb). No upstream key, no cache.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/tor-api/..."
```

## Pricing
- **Free** (Free) — 2,480 calls/Mo, 2 req/s
- **Starter** ($7/Mo) — 49,500 calls/Mo, 8 req/s
- **Pro** ($22/Mo) — 247,000 calls/Mo, 20 req/s
- **Mega** ($59/Mo) — 895,000 calls/Mo, 50 req/s

## Endpoints

### Tor Network

#### `GET /v1/check` — Is an IP a Tor relay / exit?

**Parameters:**
- `ip` (query, required, string) — IPv4 or IPv6 address Example: `171.25.193.25`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tor-api/v1/check?ip=171.25.193.25"
```

**Response:**
```json
{
    "data": {
        "ip": "171.25.193.25",
        "relays": [
            {
                "as": "AS198093",
                "flags": [
                    "Exit",
                    "Fast",
                    "Guard",
                    "Running",
                    "Stable",
                    "V2Dir",
                    "Valid"
                ],
                "as_name": "Foreningen for digitala fri- och rattigheter",
                "country": "se",
                "is_exit": true,
                "running": true,
                "is_guard": true,
                "nickname": "DFRI161",
                "last_seen": "2026-06-01 22:00:00",
                "first_seen": "2026-04-18 12:00:00",
                "fingerprint": "071B4087358344D5045237655632674124308C2A",
                "country_name": "Sweden",
                "or_addresses": [
                    "171.25.193.25:81",
                    "[2001:67c:289c::25]:81"
                ],
                "bandwidth_rate": 20971520,
                "exit_addresses": [
                    "171.25.193.25"
                ],
                "exit_policy_summary": {
                    "accept": [
                        "20-21",
                        "43",
                        "53",
                        "79-81",
                        "194",
                        "220",
                        "389",
                        "443",
                        "465",
                        "531",
         
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/relays` — Search the public relay list

**Parameters:**
- `search` (query, optional, string) — Nickname, fingerprint or IP
- `flag` (query, optional, string) — Exit, Guard, Fast, Stable, … Example: `Exit`
- `country` (query, optional, string) — 2-letter country code
- `running` (query, optional, string) — true or false
- `limit` (query, optional, string) — 1-200 (default 20)
- `offset` (query, optional, string) — Paging offset

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tor-api/v1/relays?flag=Exit"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "query": {
            "flag": "Exit",
            "search": null,
            "country": null,
            "running": null
        },
        "offset": 0,
        "relays": [
            {
                "as": "AS399820",
                "flags": [
                    "Exit",
                    "Fast",
                    "Guard",
                    "HSDir",
                    "Running",
                    "Stable",
                    "V2Dir",
                    "Valid"
                ],
                "as_name": "SPARKED HOST LLC",
                "country": "us",
                "is_exit": true,
                "running": true,
                "is_guard": true,
                "nickname": "SENDNOOSEplz",
                "last_seen": "2026-06-01 22:00:00",
                "first_seen": "2026-04-06 23:00:00",
                "fingerprint": "000F3EB75342BE371F1D8D3FAE90890AEB5664EE",
                "country_name": "United States of America",
                "or_addresses": [
                    "204.137.14.106:443"
                ],
                "bandwidth_rate": 12697600,
                "exit_addresses": [
                    "204.137.14.106"
                ],
                "exit_policy_summary": {
                    "accept": [
                        "20-23",
                        "43",
                        "53",
                        "79-81",
                        "88",
         
…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Sources, flags & notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/tor-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Look up the live Tor network as an API, powered by the Tor Project's official Onionoo service and the canonical bulk exit-node list. /v1/check?ip=171.25.193.25 tells you whether an IPv4 or IPv6 address is a Tor relay (is_tor_relay) and whether it is an exit node clients can leave the network through (is_exit_node, corroborated by in_bulk_exit_list), with the full matching relay record(s) — nickname, fingerprint, flags, country, autonomous system, bandwidth, exit-policy summary and first/last-seen. /v1/relays searches the public relay list by nickname, fingerprint, IP, country or flag (Exit, Guard, …) with paging. Ideal for fraud and abuse triage, login-risk scoring, comment/registration filtering and network research — knowing whether a connection originates from the Tor network. Data fetched live from the Tor Project (public). A Tor-network lookup — distinct from cloud/CDN attribution (cloudips), IP geolocation (ipgeo), ASN/BGP ownership (asn, ripestat) and open-port exposure (internetdb).",
        "flags": [
            "Exit",
            "Guard",
            "Fast",
            "Stable",
            "Running",
            "Valid",
            "HSDir",
            "V2Dir",
            "Authority",
            "BadExit"
        ],
        "source": "Tor Project — Onionoo (onionoo.torproject.org) + bulk exit list (check.torproject.org)",
        "endpoints": [
            "/v1/check",
            "/v1/relays",
            "/v1/meta
…(truncated, see openapi.json for full schema)
```


---
Marketplace page: https://www.oanor.com/api/tor-api
OpenAPI spec: https://www.oanor.com/api/tor-api/openapi.json
