Skip to content

[bug] GetEmissionsDataForLocationByTime ignores startTime/endTime — always returns current data #74

@amellier

Description

@amellier

Summary

The Go SDK method GetEmissionsDataForLocationByTime sends startTime and endTime as query parameters to /emissions/bylocation, but the Carbon Aware SDK server ignores them and always returns the most recent real-time measurement regardless of the requested window.

Steps to reproduce

# Request data for yesterday
curl "http://localhost:7031/emissions/bylocation?location=westus&startTime=2026-04-22T16:00:00Z&endTime=2026-04-22T17:00:00Z"

Response returns data timestamped now, not for the requested range:

[{"location": "CAISO_NORTH", "time": "2026-04-23T16:10:00+00:00", "rating": 0, "duration": "00:05:00"}]

Impact

Makes historical backfill via the SDK impossible. Any fallback or gap-filling logic that relies on this endpoint for past data will silently receive current (possibly also broken) data instead. A direct call to the provider API is required as a workaround.

Confirmed on Carbon Aware SDK v1.8.0 with WattTime as data source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions