Example
Macro Calendar Filter
Display macro events that may affect trading plans.
Request
GET https://api.earningsapi.com/v1/calendar/economic?date=today&usmajor=true&apikey=YOUR_API_KEYCode example
ExamplePython
import requests
API_KEY = "YOUR_API_KEY"
response = requests.get("https://api.earningsapi.com/v1/calendar/economic?date=today&usmajor=true", params={"apikey": API_KEY}, timeout=30)
response.raise_for_status()
print(response.json())Result shape
| country | eventName | time | consensus |
|---|---|---|---|
| United States | PPI | 08:30 ET | 0.2% |
| United States | Core PPI | 08:30 ET | 0.3% |
Build steps
- 1Call the economic calendar endpoint for date=today.
- 2Set usmajor=true when the dashboard only needs U.S. major events.
- 3Render time, actual, consensus, and previous fields in the event row.