Complete reference for integrating upstream cost data and SEC financials into your applications. RESTful endpoints with JSON responses and comprehensive filtering.
๐ Get API TokenConnect Claude Desktop, Cursor, or Claude Code directly to AFE Leaks data. Ask questions naturally and your AI calls our 14 database tools automatically.
Setup Guide
All upstream data endpoints now support OData v4 protocol for seamless integration with Excel, Power BI, and other business intelligence tools.
Use $filter, $select, $orderby, and more.
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
Session-based tokens for web applications. Tokens expire and require refresh.
Authorization: Bearer <firebase_token>
Get token: Via Firebase Auth in web applications
Login to get your personal API access token for authentication.
Get API Token โhttps://api.afeleaks.com
All API endpoints are relative to this base URL.
Access well costs, production data, and completion details from 102,000+ wells
Well-level cost summaries
/api/cost-data
Returns summarized cost data by well (API-level)
/api/cost-breakdown
Returns line-item level cost details
Well information and details
/api/wells
General well metadata with dynamic column selection
/api/locations
Well-path or location data (WKT format)
Production and revenue data
/api/production
Production records by well and date
/api/product
Product revenue data with well information
Completion and geology data
/api/casing
Casing design records
/api/formations
Formation tops and geology records
/api/surveys
Directional survey records
/api/welltests
Flow/pressure test data
Vendor costs and regulatory files
/api/vendor-costs
Vendor cost data with well information
/api/files
Regulatory file links and documents
limit
Max records (default: 100, max: 10,000)
offset
Skip N records for pagination
API
API well number
operator
Operator name
state
State
county
County
reservoir
Reservoir/formation
lease
Lease name
leaseNum
Lease number
wellNum
Well number
district
Regulatory district
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)
Detailed descriptions of all columns returned by upstream data endpoints
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 nameleaseNum โ Lease numberwellNum โ Well numberdistrict โ Regulatory districtcounty โ County nameoilGas โ Well type (oil/gas/both)field โ Field namefieldNum โ Field numberspudDate โ 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 datefirst_production โ Date of first productionlast_production โ Date of last productionreservoir โ Cleaned/standardized reservoir namelateral โ 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 โ Stateplug_date โ Plugging datecasing_design โ Casing design descriptionupdate_date โ Date of last updateTaxpayerNumber โ Primary taxpayer numberTaxpayerName โ Primary taxpayer nameTaxSubType โ Tax subtype (if applicable)date โ Production/revenue dateleaseNum โ Lease numberdistrict โ Regulatory districtSecondaryTaxpayerNumber โ Secondary taxpayer numberSecondaryTaxpayerName โ Secondary taxpayer nameAPIGravity โ API gravity (oil quality measure)volume โ Product volume (e.g., barrels, mcf, etc.)value โ Product value (USD)marketing โ Marketing adjustment or revenueproduct โ Product type (oil, gas, NGL, etc.)leaseOil โ Lease oil production (bbl)leaseGas โ Lease gas production (mcf)update_date โ Date of last updateAPI โ API well numbertype โ AFE/Actualcapex โ Total capital expenditure (USD)component โ Cost component (e.g., drilling, completion)update_date โ Date of last updateoperator โ Operator name (cleaned)state โ Statecounty โ Countyreservoir โ Reservoir namelease โ Lease namewellNum โ Well numberspudDate โ Spud datefp_year โ First production yearperf_interval โ Perforated interval (ft)tvd โ True vertical depth (ft)afedate โ AFE dateAPI โ API well numbercost_type โ AFE/Actualtype โ Cost type (e.g., material, service)component โ Cost component (e.g., casing, cement)code โ Cost code or identifiercategory โ Cost category (e.g., drilling, completion)value โ Cost value (USD)operator โ Operator name (cleaned)state โ Statecounty โ Countyreservoir โ Reservoir namelease โ Lease namewellNum โ Well numberspudDate โ Spud datefp_year โ First production yearperf_interval โ Perforated interval (ft)tvd โ True vertical depth (ft)afedate โ AFE dateAPI โ API well numbertype โ Casing string type (e.g., surface, production)segment โ Casing segment/intervalhole_size โ Hole size (inches)hole_depth โ Hole depth (ft)size โ Casing size (inches)weight โ Casing weight (lbs/ft)grade โ Casing gradeupdate_date โ Date of last updateAPI โ API well numberdate โ Production dateoil โ Oil produced (barrels)gas โ Gas produced (MCF)water โ Water produced (barrels)update_date โ Date of last updateAPI โ API well numbergeometry_wkt โ Well geometry/location (WKT format)update_date โ Date of last updateAPI โ API well numberMD โ Measured depth (ft)TVD โ True vertical depth (ft)Inclination โ Inclination (degrees)Azimuth โ Azimuth (degrees)DogLegSeverity โ Dog leg severityN โ North coordinateE โ East coordinateVS โ Vertical sectionupdate_date โ Date of last updateAPI โ API well numberdateTst โ Test dateoilD โ Oil rate (barrels/day)gasD โ Gas rate (MCF/day)waterD โ Water rate (barrels/day)chokeSize โ Choke sizetubingPressure โ Tubing pressure (psi)casingPressure โ Casing pressure (psi)testType โ Test typetestHours โ Test duration (hours)reservoir โ Reservoir testedupdate_date โ Date of last updateAPI โ API well numberreservoir โ Formation/reservoir nametvd โ Top TVD (ft)md โ Top MD (ft)update_date โ Date of last updateAPI โ API well numberForm โ File/form typeurl โ File download URLupdate_date โ Date of last updateAPI โ API well numberdate โ Cost datevendor โ Vendor namecode โ Vendor cost codetype โ Cost typedescription โ Cost descriptionnote โ Additional notescost โ Cost amount (USD)link โ Reference linkcost_type โ AFE/Actualrig โ Rig informationphase โ Project phaseAccess SEC XBRL financial data from 10-K and 10-Q filings with comprehensive filtering
Filing metadata
/api/financials/sub
Company submission metadata (filing information)
Display information
/api/financials/pre
Presentation/display info for financial statement elements
Financial values
/api/financials/num
Numeric financial data values from SEC filings
Narrative content
/api/financials/text
Text/narrative financial data
/api/financials/textbig
Large text content (MD&A, footnotes) in chunks
cik โ Central Index Key (company identifier)name โ Company nameadsh โ Accession number (filing identifier)sic โ Standard Industrial Classificationfye โ Fiscal year end (MMDD)form โ SEC form type (10-K, 10-Q, etc.)period โ Reporting period end datefiled โ Filing dateaccepted โ SEC acceptance dateprevrpt โ Previous report indicatordetail โ Detail levelinstance โ XBRL instance documentadsh โ Accession numbertag โ XBRL tag nameversion โ Taxonomy versionplabel โ Presentation labelnegating โ Negating multiplierstmt โ Statement type (BS, IS, CF, EQ)inpth โ Presentation pathrfile โ R file referencerorder โ Report ordertbl โ Table identifieradsh โ Accession numbertag โ XBRL tag nameversion โ Taxonomy versionenddate โ Period end dateqtrs โ Number of quartersuom โ Unit of measurevalue โ Numeric valuefootnote โ Footnote referencefiled โ Filing dateaxis โ Dimensional axissegment โ Dimensional segmentadsh โ Accession numbertag โ XBRL tag nameversion โ Taxonomy versionenddate โ Period end dateqtrs โ Number of quartersvalue โ Text valuefootnote โ Footnote referencefiled โ Filing dateaxis โ Dimensional axissegment โ Dimensional segmentadsh โ Accession numbertag โ XBRL tag nameversion โ Taxonomy versionenddate โ Period end dateqtrs โ Number of quarterschunk_order โ Chunk sequence numbervalue โ Large text chunkfootnote โ Footnote referencefiled โ Filing dateaxis โ Dimensional axissegment โ Dimensional segment
All upstream data endpoints support OData v4 protocol, enabling direct integration with Excel, Power BI, Tableau, and other business intelligence tools.
Query data using standard OData operators like $filter, $select, $orderby, $top, and $skip.
https://api.afeleaks.com/api/odata/
OData endpoints use HTTP Basic Authentication. Use apikey as the username and your API key as the password.
Excel / Power Query: When prompted for credentials, select "Basic" authentication, enter apikey as username, and paste your API key as the password.
| Endpoint | Description |
|---|---|
| Upstream Data (Wells with Cost Data) | |
/api/odata/Wells |
Well metadata (API, operator, county, state, reservoir, depths, etc.) |
/api/odata/CostData |
Summarized well cost data (AFE and Actual totals) |
/api/odata/CostBreakdown |
Detailed line-item cost breakdowns |
/api/odata/Production |
Monthly production data (oil, gas, water volumes) |
/api/odata/Casing |
Casing string details and specifications |
/api/odata/Locations |
Well location coordinates |
/api/odata/Surveys |
Directional survey data |
/api/odata/WellTests |
Well test results and measurements |
/api/odata/Formations |
Formation tops and geological data |
/api/odata/Files |
Available document files for wells |
| Product Revenues & Vendor Costs | |
/api/odata/Product |
Product revenues by lease (oil, gas, NGL sales and GPT costs) |
/api/odata/VendorCosts |
Vendor cost data with breakdown by phase, type, and vendor |
| SEC Financial Data (XBRL) | |
/api/odata/FinancialsSub |
SEC filing submissions metadata |
/api/odata/FinancialsNum |
Raw XBRL numeric values from filings |
/api/odata/FinancialsPre |
Presentation linkbase (statement line items) |
/api/odata/FinancialsText |
Text/footnote data from filings |
/api/odata/FinancialsTextBig |
Large text blocks (chunked for performance) |
/api/odata/FinancialsStandardized |
Standardized financial metrics (revenue, EBITDA, etc.) |
Filter wells by state:
/api/odata/Wells?$filter=state eq 'TX'
Filter by operator and select specific columns:
/api/odata/Wells?$filter=operator_clean eq 'DIAMONDBACK'&$select=API,wellName,county,reservoir
Get production with pagination:
/api/odata/Production?$top=1000&$skip=0&$orderby=prod_date desc
Filter by multiple conditions:
/api/odata/Wells?$filter=state eq 'TX' and county eq 'REEVES' and perf_interval gt 5000
https://api.afeleaks.com/api/odata/Wellsapikey as the username
Tip: For large datasets, use $filter to narrow down results before loading (e.g., filter by state or operator).
curl -H "X-API-Key: afe_your_key" \
"https://api.afeleaks.com/api/cost-data?state=TX&limit=100"
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.afeleaks.com/api/cost-data?state=TX&limit=100"
curl -H "X-API-Key: afe_your_key" \
"https://api.afeleaks.com/api/production?limit=1000&offset=5000"
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.afeleaks.com/api/production?limit=1000&offset=5000"
curl -H "X-API-Key: afe_your_key" \
"https://api.afeleaks.com/api/financials/num?cik=0000078003&form=10-K"
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.afeleaks.com/api/financials/num?cik=0000078003&form=10-K"
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)))
}
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}")
// 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));
// 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
Corporate and API subscribers can connect AI tools directly to AFE Leaks data using the Model Context Protocol (MCP). Once connected, just ask questions naturally โ your AI calls our database tools automatically.
Works with any MCP-compatible client.
{
"mcpServers": {
"afeleaks": {
"url": "https://mcp.afeleaks.com/sse?api_key=YOUR_API_KEY"
}
}
}
claude mcp add afeleaks --transport sse "https://mcp.afeleaks.com/sse?api_key=YOUR_API_KEY"
search_operators
Fuzzy operator name search
query_well_costs
Well cost data (AFE vs Actual, grouped/aggregated)
query_production
Oil/gas/water production data
query_financials
SEC financials for 10 key E&Ps (EOG, DVN, OXY, etc.)
compare_costs
Side-by-side cost comparisons across operators/basins/years
lookup_well
Single well detail (metadata + costs + production)
get_basin_info
Basin geographic reference data
query_well_tests
IP / well test results
query_cost_details
Line-item cost breakdowns (casing, stimulation, cement, etc.)
query_formations
Formation tops / reservoir depths
query_casing
Casing program details
query_surveys
Directional survey data
search_xbrl_companies
Find companies in SEC database (~146 companies)
query_xbrl_raw
Raw XBRL query for any SEC filing
Once connected, just ask your AI client questions like these:
"What's the average well cost in the Delaware Basin since 2023?"
"Compare Diamondback vs Devon drilling costs for 2-mile laterals"
"Show me EOG's revenue and EBITDA trend over the last 2 years"
"Look up well 42-461-40916"
"What formations is Pioneer drilling in Midland County?"
"Cheapest wells drilled in Reeves County in 2024"
afe_)
Get up and running with the AFE Leaks API in minutes
Choose your authentication method and get your credentials.
Test the API with a simple request to get well data.
curl -H "X-API-Key: afe_your_key" \
"https://api.afeleaks.com/api/wells?limit=10"
curl -H "Authorization: Bearer YOUR_TOKEN" \
"https://api.afeleaks.com/api/wells?limit=10"
Use the API clients or build custom integrations for your specific needs.
Our team can help you integrate AFE Leaks data into your existing systems and provide custom solutions.