Docs
Base URL https://api.texasrrcapi.com. JSON over HTTPS. Independent of and not affiliated with the Railroad Commission of Texas; built from its public files.
Quick start
Get a key on the pricing page (Free needs no card). The key is shown once.
curl https://api.texasrrcapi.com/v1/production?from=202501&to=202512 \
-H "X-API-Key: $RRC_KEY"
That returns monthly statewide oil, gas, condensate and casinghead volumes for 2025.
Authentication
Send the key in X-API-Key. The MCP endpoint also accepts Authorization: Bearer <key>. Keys are stored only as SHA-256 hashes. Rotate with POST /v1/account/rotate (the old key stops working); manage billing with POST /v1/account/portal, which returns a Stripe billing portal link.
Plans and limits
| Plan | Requests / month | Rate | Rows per call | SQL | MCP | Bulk |
|---|---|---|---|---|---|---|
| Free | 1,000 | 2 / s | 100 | No | No | No |
| Pro | 100,000 | 10 / s | 10,000 | Yes | Yes | No |
| Business | 1,000,000 | 50 / s | 10,000 | Yes | Yes | Yes |
| Enterprise | Custom | Custom | 10,000 | Yes | Yes | Yes |
GET /v1/account returns your plan, limits and usage this month. Identical GET requests may be served from the edge cache for up to five minutes; those do not count against your quota.
IDs
The same entity has the same ID in every dataset. Raw RRC columns are kept exactly as published; IDs are added beside them.
| Column | Format | Example |
|---|---|---|
operator_id | 6-digit P-5 number, leading zeros kept | 000016 |
api10 | 42 + 3-digit county + 5-digit unique | 4215130339 |
lease_id | Oil O-<district>-<5 digits>; gas well G-<6 digits> | O-01-00001 |
permit_no | 7 digits, zero-padded | 0004167 |
district | RRC code: 01–06, 6E, 7B, 7C, 08, 8A, 09, 10 | 7C |
field_no | 8 digits | 60823501 |
Typed copies of text columns end in __num (exact integers or decimals) or __date. They exist only where every value converts exactly. Decimals are returned as strings.
Provenance
Every response carries meta.snapshot_id and, per dataset used, source_release_id and conformed_release_id. Rows carry source_sha256 and source_uri: the hash and location of the original RRC file. Cite the snapshot ID to make a result reproducible.
Data notes
- Well locations (
well_locations):well_surface,well_bottomandwell_path, one row per mapped point or path, withLAT27/LONG27(NAD27, the shapefile datum) andLAT83/LONG83(NAD83), raw text plus exact__numcopies, and the geometry as WKT and WKB. About 363,000 surface points carry only a county code inAPI(no API number assigned), so they have noapi10. - Completions (
completions): one table per form and child record (packet,w2,g1,w2_casing_data,w2_formation_data, ...), joined onTRACKING_NOandPACKET_ID. A packet can appear again in later daily files; take the row with the latestsource_filedate perPACKET_ID. Twopacketcolumns the RRC manual does not document are kept asundocumented_59andundocumented_60.
Endpoints
| Request | Returns |
|---|---|
GET /v1/catalog | Datasets, tables, columns, row counts, ID and typed columns, release IDs |
GET /v1/operators/{operator_id} | P-5 record, row counts across every dataset, newest 20 drilling permits |
GET /v1/wells/{api10} | Wellbores, permits, completions (PDQ), inspections, violations, surface and bottom-hole locations, well paths, completion packets (newest first) |
GET /v1/leases/{lease_id} | Monthly production (date order), wellbores, inspections |
GET /v1/permits/{permit_no} | Permit records from the master, daily and horizontal files, inspections |
GET /v1/production?group_by=&id=&from=&to= | Monthly totals: state, district, operator or field; months as YYYYMM. Oil and condensate in bbl, gas in mcf |
GET /v1/tables/{dataset}/{table}?col=value&limit=&after= | Any table with equality filters; page with next_cursor passed as after |
POST /v1/query | Read-only SQL (Pro and up) |
GET /v1/bulk?dataset= | Signed Parquet download links (Business and up) |
GET /v1/changes?since= | Change feed |
GET /v1/status | Freshness per dataset (no key) |
GET /v1/account | Plan, limits, usage |
Example: an operator
curl https://api.texasrrcapi.com/v1/operators/257097 -H "X-API-Key: $RRC_KEY"
{"data": {"organization": {"operator_id": "257097", ...},
"counts": {"drilling_permits.da_permit": 19549, "wellbore_ewa.og_wellbore_ewa": 15181,
"inspections.inspections": 165, "violations.violations": 13, ...},
"recent_permits": {"rows": [...], "truncated": false}},
"meta": {"snapshot_id": "...", "sources": {"p5_organizations": {"source_release_id": "..."}, ...}}}
MCP for agents
Streamable HTTP at https://api.texasrrcapi.com/mcp (Pro and up). Tools: catalog, get_operator, get_well, get_lease, get_permit, get_production, query_sql. Results match the REST API, provenance included.
Claude Code
claude mcp add --transport http texasrrcapi https://api.texasrrcapi.com/mcp \
--header "Authorization: Bearer $RRC_KEY"
Cursor and other clients (mcp.json)
{"mcpServers": {"texasrrcapi": {"url": "https://api.texasrrcapi.com/mcp",
"headers": {"Authorization": "Bearer YOUR_KEY"}}}}
SQL
DuckDB SQL over "<dataset>"."<table>", read-only: no writes, no file or network access, settings locked. 15-second timeout; up to 10,000 rows (limit). Precomputed rollups live in agg.production_state, agg.production_district, agg.production_operator and agg.production_field.
curl https://api.texasrrcapi.com/v1/query -H "X-API-Key: $RRC_KEY" -H "content-type: application/json" \
-d '{"sql": "SELECT district, sum(LEASE_OIL_PROD_VOL__num) oil FROM \"pdq\".\"og_lease_cycle\" WHERE CYCLE_YEAR_MONTH__num BETWEEN 202501 AND 202512 GROUP BY 1 ORDER BY 2 DESC"}'
Bulk downloads
GET /v1/bulk (Business and up) lists every table of the current snapshot as zstd Parquet with row count, size, SHA-256 and a signed download link valid for up to one hour. Add ?dataset=pdq for one dataset. Check the SHA-256 after download.
Change feed
GET /v1/changes?since=2026-10-01 or ?since=<snapshot_id> lists each new snapshot: which datasets got a new source release and how each table's row count moved. Poll it, then re-pull only what changed. Changes are reported per dataset and table, not per row.
Status
api.texasrrcapi.com/status shows every dataset's upstream schedule, last change and row count. JSON at /v1/status, no key required.
Errors
| Status | Meaning |
|---|---|
| 400 | Malformed ID or parameter; the message gives the expected format |
| 401 | Missing, invalid or revoked key |
| 403 | Your plan does not include this feature (SQL, MCP, bulk) |
| 404 | Entity not found in the current snapshot |
| 408 | SQL query exceeded 15 seconds |
| 429 | Rate limit or monthly quota reached |
| 503 | A snapshot is loading; retry shortly |