Register for a PJM Data Miner 2 account at the PJM website; some datasets are publicly accessible while others require a subscription or market participant credentials.
Browse the API documentation and dataset catalog at dataminer2.pjm.com to identify the dataset name for your target data (e.g., 'da_hrl_lmps' for day-ahead hourly LMPs, 'rt_hrl_lmps' for real-time).
Construct a GET or POST request to the Data Miner 2 REST API endpoint, providing the dataset name, date range (startRow/endRow or datetime parameters), and desired fields; include your API key in the request header or as a parameter per the documentation.
Handle pagination: Data Miner 2 returns data in pages with a configurable row limit; check the 'isLastPage' flag in the response and iterate with incremented startRow until all pages are retrieved.
For LMP data, parse the pnode_id, datetime_beginning_ept (Eastern Prevailing Time), total_lmp_da or total_lmp_rt, and the congestion/loss component columns.
Known gotchas
PJM timestamps are in Eastern Prevailing Time (EPT), which switches between EST and EDT; this means the raw datetime strings change offset twice per year and naive UTC conversion using a fixed offset will be wrong for half the year.
Some PJM datasets have a publication lag and the most recent hours or days may not yet be available; querying for very recent data returns empty results rather than an error — build logic to detect empty pages and retry after the expected publication time.
The dataset schema and field names in Data Miner 2 occasionally change when PJM updates its systems; pin to documented field names and add schema validation to catch breaking changes before they silently corrupt downstream data.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp