Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using multiple data parameters #10

Open
leighmatth opened this issue Aug 17, 2023 · 1 comment
Open

Using multiple data parameters #10

leighmatth opened this issue Aug 17, 2023 · 1 comment
Assignees

Comments

@leighmatth
Copy link

Hi @RamiKrispin

Would it be possible to add the capability to define multiple data parameters? It looks like with the current version only one data parameter can be used.

For example, I'd like to pull the following information (eia page):

X-Params: {
    "frequency": "monthly",
    "data": [
        "average-heat-content",
        "consumption-for-eg",
        "consumption-for-eg-btu",
        "generation",
        "gross-generation",
        "total-consumption",
        "total-consumption-btu"
    ],
    "facets": {
        "fuel2002": [
            "ANT",
            "BIT",
            "LIG",
            "SUB"
        ],
        "plantCode": [
            6137
        ]
    },
    "start": null,
    "end": null,
    "sort": [
        {
            "column": "period",
            "direction": "desc"
        }
    ],
    "offset": 0,
    "length": 5000
}

Which has the API URL:

https://api.eia.gov/v2/electricity/facility-fuel/data/?frequency=monthly&data[0]=average-heat-content&data[1]=consumption-for-eg&data[2]=consumption-for-eg-btu&data[3]=generation&data[4]=gross-generation&data[5]=total-consumption&data[6]=total-consumption-btu&facets[fuel2002][]=ANT&facets[fuel2002][]=BIT&facets[fuel2002][]=LIG&facets[fuel2002][]=SUB&facets[plantCode][]=6137&sort[0][column]=period&sort[0][direction]=desc&offset=0&length=5000

With the current version, it seems like I can only pull one of those data parameters (e.g., "average_heat_content") at a time using the eia_get function.

@RamiKrispin RamiKrispin self-assigned this Aug 27, 2023
@RamiKrispin RamiKrispin added this to the CRAN Version 0.1.3 milestone Aug 27, 2023
@RamiKrispin
Copy link
Owner

Hi @leighmatth, will check how simple it would be to add it as a feature and update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants