AFE Leaks

AFE Leaks API Documentation

Complete reference for integrating upstream cost data and SEC financials into your applications. RESTful endpoints with JSON responses and comprehensive filtering.

๐Ÿ”‘ Get API Token

๐Ÿ” Authentication

๐Ÿ”‘ API Key (Recommended)

Permanent API keys for integrations, scripts, and external tools. No expiration or refresh needed.

X-API-Key: afe_your_api_key_here

Get your key: Login to API Portal

๐Ÿ”ฅ Firebase Token

Session-based tokens for web applications. Tokens expire and require refresh.

Authorization: Bearer <firebase_token>

Get token: Via Firebase Auth in web applications

Need an API Token?

Login to get your personal API access token for authentication.

Get API Token โ†’

๐ŸŒ Base URL

https://api.afeleaks.com

All API endpoints are relative to this base URL.

๐Ÿ›ข๏ธ Upstream Data Endpoints

Access well costs, production data, and completion details from 100,000+ wells

๐Ÿ’ฐ

Cost Data

Well-level cost summaries

GET /api/cost-data

Returns summarized cost data by well (API-level)

GET /api/cost-breakdown

Returns line-item level cost details

๐Ÿ”

Wells & Metadata

Well information and details

GET /api/wells

General well metadata with dynamic column selection

GET /api/locations

Well-path or location data (WKT format)

๐Ÿ“Š

Production & Revenue

Production and revenue data

GET /api/production

Production records by well and date

GET /api/product

Product revenue data with well information

๐Ÿ”ง

Technical Details

Completion and geology data

GET /api/casing

Casing design records

GET /api/formations

Formation tops and geology records

GET /api/surveys

Directional survey records

GET /api/welltests

Flow/pressure test data

๐Ÿญ

Vendor & Files

Vendor costs and regulatory files

GET /api/vendor-costs

Vendor cost data with well information

GET /api/files

Regulatory file links and documents

โš™๏ธ Common Parameters

Pagination

limit Max records (default: 100, max: 10,000)
offset Skip N records for pagination

Well Filters

API API well number
operator Operator name
state State
county County
reservoir Reservoir/formation

Location Filters

lease Lease name
leaseNum Lease number
wellNum Well number
district Regulatory district

Date Range Filters

spudDateMin Min spud date (YYYY-MM-DD)
spudDateMax Max spud date (YYYY-MM-DD)
updateDateMin Min update date (YYYY-MM-DD)
updateDateMax Max update date (YYYY-MM-DD)

๐Ÿ“Š Column Reference

Detailed descriptions of all columns returned by upstream data endpoints

๐Ÿ” og_data (Well Metadata)

Note: The /api/wells endpoint supports dynamic column selection using the columns parameter. You can specify which columns to return (e.g., ?columns=API,operator,state,spudDate) from any of the columns listed below.

API โ€“ 10- or 12-digit API well number (unique well identifier)
api12 โ€“ 12-digit API number (alternate format)
api14 โ€“ 14-digit API number (alternate format)
lease โ€“ Lease name
leaseNum โ€“ Lease number
wellNum โ€“ Well number
district โ€“ Regulatory district
county โ€“ County name
oilGas โ€“ Well type (oil/gas/both)
field โ€“ Field name
fieldNum โ€“ Field number
spudDate โ€“ Date well was spudded (drilling started)
lastSpud โ€“ Date of last spud (if re-entered)
operator โ€“ Operator name (current or at time of record)
operator_clean โ€“ Cleaned operator name (standardized)
compDate โ€“ Completion date
first_production โ€“ Date of first production
last_production โ€“ Date of last production
reservoir โ€“ Cleaned/standardized reservoir name
lateral โ€“ Lateral length (ft)
tvd โ€“ True vertical depth (ft)
md โ€“ Measured depth (ft)
perf_top โ€“ Top of perforated interval (ft)
perf_bottom โ€“ Bottom of perforated interval (ft)
perf_interval โ€“ Perforated interval length (ft)
depth โ€“ Total depth (ft)
fluid โ€“ Total fluid used (gallons)
proppant โ€“ Total proppant used (lbs)
prop_per_ft โ€“ Proppant per foot (lbs/ft)
location โ€“ Well location (legal description or lat/lon)
state โ€“ State
plug_date โ€“ Plugging date
casing_design โ€“ Casing design description
update_date โ€“ Date of last update
๐Ÿ“Š product (Production/Revenue Data)
TaxpayerNumber โ€“ Primary taxpayer number
TaxpayerName โ€“ Primary taxpayer name
TaxSubType โ€“ Tax subtype (if applicable)
date โ€“ Production/revenue date
leaseNum โ€“ Lease number
district โ€“ Regulatory district
SecondaryTaxpayerNumber โ€“ Secondary taxpayer number
SecondaryTaxpayerName โ€“ Secondary taxpayer name
APIGravity โ€“ API gravity (oil quality measure)
volume โ€“ Product volume (e.g., barrels, mcf, etc.)
value โ€“ Product value (USD)
marketing โ€“ Marketing adjustment or revenue
product โ€“ Product type (oil, gas, NGL, etc.)
leaseOil โ€“ Lease oil production (bbl)
leaseGas โ€“ Lease gas production (mcf)
update_date โ€“ Date of last update
๐Ÿ’ฐ cost_data_aggregate (Cost Data Summary)
API โ€“ API well number
type โ€“ AFE/Actual
capex โ€“ Total capital expenditure (USD)
component โ€“ Cost component (e.g., drilling, completion)
update_date โ€“ Date of last update
operator โ€“ Operator name (cleaned)
state โ€“ State
county โ€“ County
reservoir โ€“ Reservoir name
lease โ€“ Lease name
wellNum โ€“ Well number
spudDate โ€“ Spud date
fp_year โ€“ First production year
perf_interval โ€“ Perforated interval (ft)
tvd โ€“ True vertical depth (ft)
afedate โ€“ AFE date
๐Ÿ’ธ cost_breakdown_details (Cost Line Items)
API โ€“ API well number
cost_type โ€“ AFE/Actual
type โ€“ Cost type (e.g., material, service)
component โ€“ Cost component (e.g., casing, cement)
code โ€“ Cost code or identifier
category โ€“ Cost category (e.g., drilling, completion)
value โ€“ Cost value (USD)
operator โ€“ Operator name (cleaned)
state โ€“ State
county โ€“ County
reservoir โ€“ Reservoir name
lease โ€“ Lease name
wellNum โ€“ Well number
spudDate โ€“ Spud date
fp_year โ€“ First production year
perf_interval โ€“ Perforated interval (ft)
tvd โ€“ True vertical depth (ft)
afedate โ€“ AFE date
Note: No update_date column
๐Ÿ”ง casing_data (Casing Design)
API โ€“ API well number
type โ€“ Casing string type (e.g., surface, production)
segment โ€“ Casing segment/interval
hole_size โ€“ Hole size (inches)
hole_depth โ€“ Hole depth (ft)
size โ€“ Casing size (inches)
weight โ€“ Casing weight (lbs/ft)
grade โ€“ Casing grade
update_date โ€“ Date of last update
๐Ÿ›ข๏ธ prod_data (Production Data)
API โ€“ API well number
date โ€“ Production date
oil โ€“ Oil produced (barrels)
gas โ€“ Gas produced (MCF)
water โ€“ Water produced (barrels)
update_date โ€“ Date of last update
๐Ÿ“ locs (Well Locations)
API โ€“ API well number
geometry_wkt โ€“ Well geometry/location (WKT format)
update_date โ€“ Date of last update
๐Ÿ“ survey_data (Directional Surveys)
API โ€“ API well number
MD โ€“ Measured depth (ft)
TVD โ€“ True vertical depth (ft)
Inclination โ€“ Inclination (degrees)
Azimuth โ€“ Azimuth (degrees)
DogLegSeverity โ€“ Dog leg severity
N โ€“ North coordinate
E โ€“ East coordinate
VS โ€“ Vertical section
update_date โ€“ Date of last update
๐Ÿงช test_data (Well Tests)
API โ€“ API well number
dateTst โ€“ Test date
oilD โ€“ Oil rate (barrels/day)
gasD โ€“ Gas rate (MCF/day)
waterD โ€“ Water rate (barrels/day)
chokeSize โ€“ Choke size
tubingPressure โ€“ Tubing pressure (psi)
casingPressure โ€“ Casing pressure (psi)
testType โ€“ Test type
testHours โ€“ Test duration (hours)
reservoir โ€“ Reservoir tested
update_date โ€“ Date of last update
๐Ÿ”๏ธ formation_data (Formation Tops)
API โ€“ API well number
reservoir โ€“ Formation/reservoir name
tvd โ€“ Top TVD (ft)
md โ€“ Top MD (ft)
update_date โ€“ Date of last update
๐Ÿ“„ file_links (Regulatory Files)
API โ€“ API well number
Form โ€“ File/form type
url โ€“ File download URL
update_date โ€“ Date of last update
๐Ÿญ vendor_costs (Vendor Cost Data)
API โ€“ API well number
date โ€“ Cost date
vendor โ€“ Vendor name
code โ€“ Vendor cost code
type โ€“ Cost type
description โ€“ Cost description
note โ€“ Additional notes
cost โ€“ Cost amount (USD)
link โ€“ Reference link
cost_type โ€“ AFE/Actual
rig โ€“ Rig information
phase โ€“ Project phase
Note: Joined with og_data for well metadata

๐Ÿ’ผ SEC Financial Data Endpoints

Access SEC XBRL financial data from 10-K and 10-Q filings with comprehensive filtering

๐Ÿ“„

Submissions

Filing metadata

GET /api/financials/sub

Company submission metadata (filing information)

๐ŸŽจ

Presentation

Display information

GET /api/financials/pre

Presentation/display info for financial statement elements

๐Ÿ”ข

Numeric Data

Financial values

GET /api/financials/num

Numeric financial data values from SEC filings

๐Ÿ“

Text Data

Narrative content

GET /api/financials/text

Text/narrative financial data

GET /api/financials/textbig

Large text content (MD&A, footnotes) in chunks

๐Ÿ“Š SEC Financial Data Tables

๐Ÿ“‹ sub (Company Submissions)
cik โ€“ Central Index Key (company identifier)
name โ€“ Company name
adsh โ€“ Accession number (filing identifier)
sic โ€“ Standard Industrial Classification
fye โ€“ Fiscal year end (MMDD)
form โ€“ SEC form type (10-K, 10-Q, etc.)
period โ€“ Reporting period end date
filed โ€“ Filing date
accepted โ€“ SEC acceptance date
prevrpt โ€“ Previous report indicator
detail โ€“ Detail level
instance โ€“ XBRL instance document
๐ŸŽจ pre (Presentation Data)
adsh โ€“ Accession number
tag โ€“ XBRL tag name
version โ€“ Taxonomy version
plabel โ€“ Presentation label
negating โ€“ Negating multiplier
stmt โ€“ Statement type (BS, IS, CF, EQ)
inpth โ€“ Presentation path
rfile โ€“ R file reference
rorder โ€“ Report order
tbl โ€“ Table identifier
๐Ÿ”ข num (Numeric Financial Data)
adsh โ€“ Accession number
tag โ€“ XBRL tag name
version โ€“ Taxonomy version
enddate โ€“ Period end date
qtrs โ€“ Number of quarters
uom โ€“ Unit of measure
value โ€“ Numeric value
footnote โ€“ Footnote reference
filed โ€“ Filing date
axis โ€“ Dimensional axis
segment โ€“ Dimensional segment
๐Ÿ“ text (Text Financial Data)
adsh โ€“ Accession number
tag โ€“ XBRL tag name
version โ€“ Taxonomy version
enddate โ€“ Period end date
qtrs โ€“ Number of quarters
value โ€“ Text value
footnote โ€“ Footnote reference
filed โ€“ Filing date
axis โ€“ Dimensional axis
segment โ€“ Dimensional segment
๐Ÿ“„ textbig (Large Text Content)
adsh โ€“ Accession number
tag โ€“ XBRL tag name
version โ€“ Taxonomy version
enddate โ€“ Period end date
qtrs โ€“ Number of quarters
chunk_order โ€“ Chunk sequence number
value โ€“ Large text chunk
footnote โ€“ Footnote reference
filed โ€“ Filing date
axis โ€“ Dimensional axis
segment โ€“ Dimensional segment

๐Ÿ’ก API Examples

Get Cost Data for Texas Wells

๐Ÿ”‘ Using API Key

curl -H "X-API-Key: afe_your_key" \
  "https://api.afeleaks.com/api/cost-data?state=TX&limit=100"

๐Ÿ”ฅ Using Firebase Token

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.afeleaks.com/api/cost-data?state=TX&limit=100"

Get Production Data with Pagination

๐Ÿ”‘ Using API Key

curl -H "X-API-Key: afe_your_key" \
  "https://api.afeleaks.com/api/production?limit=1000&offset=5000"

๐Ÿ”ฅ Using Firebase Token

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.afeleaks.com/api/production?limit=1000&offset=5000"

Get Financial Data for Specific Company

๐Ÿ”‘ Using API Key

curl -H "X-API-Key: afe_your_key" \
  "https://api.afeleaks.com/api/financials/num?cik=0000078003&form=10-K"

๐Ÿ”ฅ Using Firebase Token

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.afeleaks.com/api/financials/num?cik=0000078003&form=10-K"

๐Ÿ“ Programming Language Examples

๐Ÿ“Š R (with API Key)

library(httr)
library(jsonlite)

# Using permanent API key
api_key <- "afe_your_generated_key_here"

resp <- GET(
  url = "https://api.afeleaks.com/api/wells",
  query = list(limit = 10, state = "TX"),
  add_headers(`X-API-Key` = api_key)
)

if (status_code(resp) == 200) {
  data <- content(resp, "parsed")
  wells_df <- data$data
} else {
  print(paste("Error:", status_code(resp)))
}

๐Ÿ Python (with API Key)

import requests
import pandas as pd

# Using permanent API key
api_key = "afe_your_generated_key_here"
headers = {"X-API-Key": api_key}

response = requests.get(
    "https://api.afeleaks.com/api/wells",
    params={"limit": 10, "state": "TX"},
    headers=headers
)

if response.status_code == 200:
    data = response.json()
    wells_df = pd.DataFrame(data["data"])
else:
    print(f"Error: {response.status_code}")

โšก JavaScript (with API Key)

// Using permanent API key
const apiKey = "afe_your_generated_key_here";

fetch('https://api.afeleaks.com/api/wells?limit=10&state=TX', {
  headers: {
    'X-API-Key': apiKey
  }
})
.then(response => response.json())
.then(data => {
  console.log(`Retrieved ${data.data.length} wells`);
  console.log('Wells:', data.data);
})
.catch(error => console.error('Error:', error));

๐Ÿ“ˆ Excel/Power BI

// Power Query M code
let
    apiKey = "afe_your_generated_key_here",
    url = "https://api.afeleaks.com/api/wells?limit=1000",
    headers = [#"X-API-Key" = apiKey],
    response = Web.Contents(url, [Headers = headers]),
    json = Json.Document(response),
    data = json[data],
    table = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
    table

๐Ÿš€ Quick Start Guide

Get up and running with the AFE Leaks API in minutes

1

Get Your API Credentials

Choose your authentication method and get your credentials.

2

Make Your First Request

Test the API with a simple request to get well data.

๐Ÿ”‘ With API Key

curl -H "X-API-Key: afe_your_key" \
  "https://api.afeleaks.com/api/wells?limit=10"

๐Ÿ”ฅ With Firebase Token

curl -H "Authorization: Bearer YOUR_TOKEN" \
  "https://api.afeleaks.com/api/wells?limit=10"
3

Integrate Into Your Workflow

Use the API clients or build custom integrations for your specific needs.

Need Help with Integration?

Our team can help you integrate AFE Leaks data into your existing systems and provide custom solutions.