canonical: https://jentic.com/apis/bgptools/bgptools

# BGP.tools API

The BGP.tools API exports BGP routing data sourced from a global view of the Internet routing table. It returns the full IPv4 and IPv6 prefix-to-ASN routing table, ASN-to-organisation mappings, and curated tag lists used to flag networks (for example anycast, hosting, or government). All requests must include a custom User-Agent header that identifies the requester so the operators can contact heavy users. Output is plaintext, CSV, or JSONL - there is no JSON object response.

## For AI agents

Export the global BGP routing table, ASN-to-name mappings, and curated network tags from BGP.tools for IP intelligence and network research.

## Scope

Does not handle IP geolocation, abuse reporting, or whois lookups - use for BGP routing table exports and ASN-to-organisation mappings only.

## Capabilities

- Export the full IPv4 and IPv6 BGP routing table as plaintext or JSONL
- Look up ASN-to-organisation name mappings across the global routing system
- Retrieve the list of curated tags used by BGP.tools to classify networks
- Download the members of a specific tag (such as anycast or hosting) as CSV
- Identify which prefixes are originated by a given autonomous system
- Bulk-download routing data for offline IP-to-ASN enrichment pipelines

## Use cases

### IP-to-ASN Enrichment Pipeline

Build an offline IP-to-ASN lookup service by ingesting the BGP.tools routing table once per hour and indexing the prefix-to-ASN map locally. The /table.jsonl endpoint streams every announced prefix with its origin ASN, which lets you classify any inbound IP address by its network owner. Typical setup time is under a day; the enrichment service can serve millions of lookups per second from memory.

Example prompt: Download /table.jsonl, parse each line into (prefix, asn) tuples, and build an in-memory radix tree for IP-to-ASN lookups.

### Network Classification with Tags

Detect whether traffic originates from a hosting provider, anycast network, or government ASN by joining inbound IP addresses against BGP.tools tag lists. Tag membership is curated by the BGP.tools team and updated continuously; agents can pull `/tags/{tagname}.csv` for any tag listed in /tags.txt and use it to flag suspicious or expected traffic patterns.

Example prompt: Fetch `/tags/hosting.csv` and produce a deduplicated set of ASNs flagged as hosting providers.

### Network Operator Reachability Reports

Generate a reachability report for a specific ASN by cross-referencing the BGP.tools routing table to find every prefix it currently originates. This is useful for network operators verifying their announcements are visible globally, or for security teams auditing the address space owned by a customer's ASN.

Example prompt: Filter /table.jsonl for entries where origin_asn equals 13335 and return the full list of prefixes Cloudflare announces.

### AI Agent Network Forensics Assistant

An AI agent helping a SOC analyst can answer questions like 'who owns this IP?' and 'is this address space hosting infrastructure?' by calling BGP.tools through Jentic. The agent does not need to handle the User-Agent header convention manually - Jentic injects it from the stored credential. ASN context is returned as plain CSV or JSONL that the agent can summarise.

Example prompt: Search Jentic for 'asn name lookup', execute /asns.csv, and return the organisation name for ASN 15169.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/table.txt` | Routing table as plaintext |
| GET | `/table.jsonl` | Routing table as JSONL stream |
| GET | `/asns.csv` | ASN to name mappings |
| GET | `/tags.txt` | List all available tags |
| GET | `/tags/{tagname}.csv` | Members of a tag as CSV |

## Key resources

- **Routing table** — Full IPv4 and IPv6 BGP table in plaintext or JSONL
- **ASN mappings** — Mapping from autonomous system numbers to organisation names
- **Tags** — Curated classifications applied to networks (hosting, anycast, etc.)

## AI readiness

This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.

- **Score:** 69 / 100
- **Maturity:** AI-Aware
- **Dimensions:**
  - Foundational Compliance: 100 / 100
  - Developer Experience & Jentic Compatibility: 63 / 100
  - AI-Readiness & Agent Experience: 53 / 100
  - Agent Usability: 94 / 100
  - Security: 50 / 100
  - AI Discoverability: 100 / 100
- **View full report:** https://jentic.com/apis/bgptools/bgptools/scorecard
- **How the score is calculated:** https://docs.jentic.com/reference/api-readiness-framework/overview/
- **More about the dimensions:** https://docs.jentic.com/reference/api-readiness-framework/specification/#dimensional-model-overview

### Score it yourself

Every API in the directory is allowlisted, so you can re-score it with no key required.

- **Score your own API:** https://jentic.com/scorecard.md
- **Scoring CLI agent skill:** https://github.com/jentic/jentic-api-scorecard/blob/main/skills/jentic-api-scorecard/SKILL.md

```sh
npx @jentic/api-scorecard-cli score <openapi-url>
```

## Why Jentic

- **Setup:** Wiring the BGP.tools API by hand means sending the required User-Agent identifier on every request and parsing its plain-text, JSONL, and CSV table exports yourself. Through Jentic you install once, import BGP.tools from the API Directory, store the identifier once, and your agent calls it.
- **Permission scoping:** BGP.tools exposes fixed export files with the tag name in the path (`/tags/{tagname}.csv`), so limit the agent to the operations it needs, such as fetching the routing table or ASN list. You choose that set, so tag exports are not reachable unless you include them, and every operation is a read-only export.
- **Credential handling:** Your BGP.tools User-Agent identifier is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'export the BGP routing table' or 'map an ASN to an organisation', and Jentic returns the matching BGP.tools operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Shodan API** — Shodan indexes hosts and services per IP, while BGP.tools focuses on routing-layer ownership.
- **ipgeolocation.io API** — ipgeolocation.io adds country, city, and timezone data to IP addresses identified via BGP.tools.
- **AbuseIPDB API** — AbuseIPDB returns abuse confidence scores for IPs that BGP.tools resolves to ASNs.

## FAQ

### What authentication does the BGP.tools API use?

BGP.tools requires a custom User-Agent header on every request that identifies the caller (project name and contact email is the convention). The OpenAPI spec models this as an apiKey scheme on the User-Agent header. Through Jentic, the User-Agent value is stored encrypted in your Jentic One instance and injected at execution time so the agent never sees the raw value.

### Can I get the full BGP routing table from the BGP.tools API?

Yes. GET /table.txt returns the routing table in plaintext, and GET /table.jsonl returns the same data as newline-delimited JSON, which is more practical for streaming ingestion into a pipeline. Both endpoints cover the global IPv4 and IPv6 announced prefixes.

### What are the rate limits for the BGP.tools API?

BGP.tools does not publish hard rate limits in the spec, but the operators ask for a real, contactable User-Agent and request that bulk consumers cache results rather than re-downloading the multi-megabyte table on every request. Refresh hourly at most for the routing table; tag lists change less frequently.

### How do I look up an ASN through Jentic?

Search Jentic for 'asn name mapping' or 'GET /asns.csv', load the schema, and execute. With the SDK: pip install jentic, then SearchRequest, LoadRequest, and ExecutionRequest in an async flow - Jentic injects the configured User-Agent automatically.

### Is the BGP.tools API free?

Yes - the data export endpoints are free for use as long as you provide a contactable User-Agent so the operators can reach you if your usage causes problems. There is no commercial tier specified in the OpenAPI spec.

### Can I limit what my agent is allowed to do with the BGP.tools API?

Yes. Because Jentic One is self-hosted, you decide which BGP.tools operations your agent may call and which credential it uses, so you can allow only the exports it needs, such as the routing table (GET /table.jsonl) or the ASN-to-name mappings (GET /asns.csv). Every BGP.tools operation is a read-only export, and the tag exports (GET `/tags/{tagname}.csv`) are not reachable unless you include them in that set. The stored User-Agent identifier is injected at execution time and never enters the agent's context.
