· 13 min read
EIA Scraper - US Energy Data (Petroleum, Gas, Electricity): Setup
A thousand records of flat, analysis-ready energy data cost $5.00 on the free-plan price, and each returned record carries 18 output fields from official U.S. Energy Information Administration (EIA) surveys. By extracting data from EIA's public bulk-download files instead of using API calls, this collector delivers petroleum, natural gas, electricity, coal, nuclear, and total energy metrics without requiring a developer key or registration. This is built for energy traders, utility analysts, and academic researchers who need structured historical or hourly time-series data. It is not for teams who require real-time, sub-second live financial exchange feeds.
Try it: open EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) on Apify, sign in on the free plan and run the prefilled example.
Can you try EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) before paying?
Yes. Apify's free plan includes $5.00 of prepaid usage every month and asks for no credit card. At $0.005 per result, that covers up to 1,000 results of EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) a month, before run-start charges and platform usage.
The example request further down caps maxItems at 100, so a first run returns at most 100 results and costs at most $0.50 in result charges. That is enough to see the real shape of the data before deciding anything.
EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) was last updated on 2026-07-21. It is one of 1,729 Actors CrawlerBros publishes on Apify, which together have 746,619 lifetime public runs and an average rating of 4.63 out of 5 across 416 reviews.
What does it cost to run EIA Scraper - US Energy Data (Petroleum, Gas, Electricity)?
Each result costs $0.005 on Apify's free plan, which is $5.00 per 1,000 results. Starting a run is charged separately at $0.005 per GB of Actor memory. Apify also bills the platform usage each run consumes, at the rates of your Apify plan, on top of these charges.
| Apify plan | Per result | Per 1,000 results |
|---|---|---|
| FREE | $0.005 | $5.00 |
| BRONZE | $0.00433 | $4.33 |
| SILVER | $0.00367 | $3.67 |
| GOLD | $0.003 | $3.00 |
| PLATINUM | $0.003 | $3.00 |
| DIAMOND | $0.003 | $3.00 |
The category parameter has the most significant impact on your run duration and platform resource usage. Querying electricity or electricityGridOperations requires downloading and parsing large compressed bulk files of about 240 MB and 660 MB respectively, which consumes more platform CPU and RAM than other smaller categories. To check your data structure before committing resources, run a quick query using a small category like petroleum with maxItems restricted to 100.
How do you run EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) from the API?
The schema marks 1 of its 8 controls as required: category. Every value in the payload below comes from the published schema's own prefills, which means you can paste it, swap the token, and get a real result.
Call the synchronous endpoint to start a run and receive dataset items in one request:
curl -X POST "https://api.apify.com/v2/acts/crawlerbros~eia-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"category":"naturalGas","frequency":"any","region":"US","maxItems":100}'
The same run from Python, using the official client:
from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run_input = {
"category": "naturalGas",
"frequency": "any",
"region": "US",
"maxItems": 100
}
run = client.actor("crawlerbros~eia-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)
And from Node.js:
import { ApifyClient } from 'apify-client'
const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' })
const input = {
"category": "naturalGas",
"frequency": "any",
"region": "US",
"maxItems": 100
}
const run = await client.actor('crawlerbros~eia-scraper').call(input)
const { items } = await client.dataset(run.defaultDatasetId).listItems()
console.log(items)
That endpoint blocks until the run completes. Fine while you are testing a handful of records, risky once a run takes minutes: a dropped connection loses the response even though the run itself finished. Switch to an asynchronous start with polling or a webhook before you schedule anything.
Which EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) inputs matter, and which can you skip?
The category control is the only required input and dictates which underlying bulk file is fetched and processed. For targeted runs, use the seriesId parameter to instantly pull a specific data stream; this overrides all other filters and automatically matches the correct category. Most users can safely leave keyword and region blank on their first run to inspect the broader dataset before narrowing down.
category(string): Which EIA energy dataset to query. Default:"naturalGas".keyword(string): Free-text filter matched against the series name, description, and ID (e.g.diesel,storage,generation,retail sales).seriesId(string): Look up one exact EIA series ID (e.g.PET.RWTC.Dfor WTI crude spot price). If set, this overrides other filters and auto-detects the correct category from the ID's prefix.frequency(string): Restrict to series reported at this frequency. Default:"any".region(string): Restrict to series covering this US state. For Petroleum Imports, matches the US destination port's state. National/all-US series and categories without state-level breakdowns are unaffected by this filter (e.g. International Energy is filtered by country name via Keyword instead). Default:"US".startYear(integer): Only include data points from this year onward.endYear(integer): Only include data points up to and including this year.maxItems(integer): Hard cap on emitted data-point records. Default:100.
Fixed-choice controls: category accepts 12 values (default naturalGas), including naturalGas (storage, prices, production), petroleum (gasoline/diesel/crude prices, production, PADD stocks), coal (production, prices, stocks, heat content), electricity (generation, sales, prices, customers by state); frequency accepts 9 values (default any), including any (Any frequency), annual, quarterly, monthly; region accepts 52 values (default US), including US (All / National), AL (Alabama), AK (Alaska), AZ (Arizona).
What does EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) return?
The output records are structured as flat, analysis-ready rows representing one individual data point per time period. Each record contains essential metadata such as units, geography, and lastUpdated, while empty fields are omitted. This structure makes the dataset ideal for immediate ingestion into BI tools, SQL databases, or pandas DataFrames.
category- energy category label (e.g.Petroleum)seriesId- EIA series identifier (e.g.PET.RWTC.D)name,description- human-readable series descriptionunits- unit of measure (e.g.Dollars per Gallon,Thousand Barrels per Day,Megawatthours)frequency-Annual/Quarterly/Monthly/Weekly/Daily/Hourly (UTC)/Hourly (Local Time)/4-Week Averagegeography- EIA geography code (e.g.USA-TXfor a US state,ARMfor Armenia,WLDfor World) when the series is state/country-scopedgeographyDestination- for Petroleum Imports, the US destination state/port (e.g.USA-MS) whengeographyholds the origin countrylatitude,longitude- decimal coordinates of the import terminal, populated only for Petroleum Imports series that publish themperiod- raw EIA period string (e.g.2024,2024Q1,202401,20240115,20260717T06)periodYear- the 4-digit year extracted fromperiodvalue- the numeric data valuedataSource- the underlying data provider EIA credits for this series (e.g.Thomson-Reutersfor WTI spot prices,EIA, U.S. Energy Information Administrationfor most others), when publishedlastUpdated- when EIA last refreshed this seriessourceUrl- link to EIA's public query-browser page for this seriesrecordType: "energyDataPoint",scrapedAt
These are the documented fields. Optional ones can be empty on a given record, so measure how often each field your deliverable depends on is populated across a real sample before automating the handoff.
How do you build the workflow end to end?
Open EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) and work through these in order. Each step ends with something to check, so a bad configuration surfaces on a small run rather than a scheduled one.
- Select naturalGas, petroleum, or electricity inside the category control to define your target bulk data source.
- Paste an exact EIA identifier like PET.RWTC.D into the seriesId field if you already know the specific data stream you need to extract.
- Input a specific term such as diesel, storage, or generation in the keyword field to filter down the available series within your selected category.
- Restrict your query using the frequency selector to filter out unwanted reporting cadences, or leave it as any.
- Set the region dropdown to a specific US state code like TX or CA to limit the geographical scope of state-level datasets.
- Define the startYear and endYear controls to restrict the returned time series to your target analytical date range.
- Limit the data-point volume on your first execution by setting the maxItems parameter to 100.
- Run the scraper, then inspect the resulting dataset to confirm that the value, period, and seriesId fields are populated correctly.
How do you apply it? Three worked playbooks
These are EIA Scraper - US Energy Data (Petroleum, Gas, Electricity)'s own documented use cases, each worked through as an operating pattern rather than a description.
Use case 1: Energy market research
Outcome: Track historical crude oil, gasoline, diesel, and natural gas prices
Configure: Set category to "petroleum", keyword to "diesel", frequency to "weekly", and maxItems to 500.
Working method: Execute the run to pull weekly regional retail diesel prices, check that the seriesId and value fields are populated, and then expand the date range using startYear and endYear to build a long-term pricing model.
Deliverable: A CSV file containing historical weekly diesel price points across multiple US regions, featuring seriesId, period, and value.
Stop condition: The price values return as zero or empty fields for multiple consecutive historical weeks.
Use case 2: Utility & grid analytics
Outcome: Electricity generation, sales, and customer counts by US state
Configure: Set category to "electricity", keyword to "retail sales", region to "CA", startYear to 2020, and endYear to 2024.
Working method: Run the query for California electricity sales, verify that the units field displays Megawatthours, and compare the annual totals against the monthly distributions in the returned records.
Deliverable: A structured dataset containing California's electricity retail sales, customer counts, and generation figures from 2020 through 2024.
Stop condition: The geography field does not match the requested state code of CA.
Use case 3: Academic & policy research
Outcome: Bulk time-series export for econometric modeling
Configure: Set category to "totalEnergy", startYear to 2000, endYear to 2025, and maxItems to 5000.
Working method: Initialize the run to capture long-term national consumption and production trends, isolate the seriesId values matching your target sectors, and merge the flat rows into a unified master matrix.
Deliverable: A comprehensive time-series dataset of US total energy consumption and production by sector spanning a 25-year period.
Stop condition: The periodYear field contains values outside the requested 2000 to 2025 range.
What breaks, and how do you design around it?
Large bulk datasets like electricity grid operations can take several minutes to download and process in-memory. If your runs time out or consume excessive memory, increase the memory allocation of the Actor in your Apify run settings. Additionally, use the startYear and endYear controls to filter the processed rows and reduce memory load.
When should you not use EIA Scraper - US Energy Data (Petroleum, Gas, Electricity)?
Do not use this scraper if you require immediate, real-time pricing feeds for active intra-day energy trading, as the EIA bulk files are refreshed on daily, weekly, or monthly cadences depending on the survey. If you require agricultural commodity data instead of petroleum, gas, or electricity, use the USDA NASS Agricultural Statistics Scraper instead. If your project demands press releases and corporate announcements regarding energy policy rather than raw statistical time series, use the PR Newswire Scraper to monitor corporate distributions.
What should you check before trusting the output?
- Verify that the numeric value field is populated and not returned as null for each row.
- Check that the period string matches the expected format, such as a four-digit year or a monthly code like 202401.
- Confirm that the units field matches your reporting requirements, especially when aggregating petroleum or natural gas data.
- Set up a validation rule to stop scheduled runs if the dataset is completely empty, which can indicate that an upstream bulk file from the EIA is temporarily offline.
None of this proves a record is correct. It gives a scheduled EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) run defined points where it should stop instead of quietly passing bad data downstream.
Frequently asked questions
Do I need a registered EIA API key to run this scraper?
No. This scraper retrieves data directly from the official EIA bulk-download ZIP files. Because it bypasses the API Umbrella gateway entirely, you do not need to register, configure, or provide an api_key to extract the data.
What is the cost to run this scraper on Apify's free plan?
Each result costs $0.005, which is $5.00 per 1,000 results on the free plan. Apify's free plan includes $5.00 of monthly usage, which covers up to 1,000 results of this Actor before any platform usage charges are applied.
Why does the electricity grid operations category take longer to run?
The bulk file for electricityGridOperations is roughly 660 MB compressed. Downloading and parsing this file in-memory takes longer and consumes more platform resources than smaller categories like petroleum or natural gas.
How are missing values and empty fields handled in the output?
To prevent dataset clutter, empty fields are omitted from the output. If a specific series does not populate a metadata field like geography or geographyDestination, that field will not appear in the record.
How current is the energy data returned by the scraper?
The data is as current as the EIA's official bulk files. The EIA refreshes these files on the same schedule as their source surveys, which varies from daily for spot prices to weekly or monthly for storage and production.
Where to go next
When you are ready to run it, open EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) on Apify; the free plan covers up to 1,000 results a month.
Start with the EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) Actor page for the current input schema, pricing tier, and run history.
Other Actors we maintain for related data:
- USDA NASS Agricultural Statistics Scraper: Scrape USDA National Agricultural Statistics Service (NASS) QuickStats data - crop production, prices, area harvested, livestock, and agricultural census data by commodity, state, and year.
- MyHome.ie Scraper: Scrape MyHome.ie - Ireland's leading property portal.
- OnTheSnow Scraper: Scrape live ski resort conditions from OnTheSnow - lifts open/total, runs open/total, snowfall, base depth, forecast, and resort status for 300+ resorts across the US, Canada, Australia, New Zealand, Japan, Argentina, and Chile.
- PR Newswire Scraper: Scrape PR Newswire - one of the world's largest press-release distribution networks.
Related guides:
Resources
Actor documentation, input schema, and pricing: verified against the published Actor on 2026-10-06.
Actor last updated by its maintainers on 2026-07-21.
Run outcome figures cover the 30 day public window ending 2026-10-06.
EIA Scraper - US Energy Data (Petroleum, Gas, Electricity) on Apify
Featured actors
EIA Scraper - US Energy Data (Petroleum, Gas, Electricity)
Scrape U.S. Energy Information Administration (EIA) open data - energy prices, production, consumption, and stocks across petroleum, natural gas, electricity, coal, nuclear, and total energy, by state and time period. No API key required.
Run on Apify ↗