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

Doesn't seem to like many 'W' postcodes #10

Open
pafirmin opened this issue Feb 3, 2021 · 2 comments
Open

Doesn't seem to like many 'W' postcodes #10

pafirmin opened this issue Feb 3, 2021 · 2 comments

Comments

@pafirmin
Copy link

pafirmin commented Feb 3, 2021

Hi there. This may be a broader issue than stated here, but I have noticed that certain West London postcodes are not recognised by the API and a 400 error is returned along with a 'no postcode match can be found' message. A few examples are W1, W2, W3 and W7.

Example request:
curl -X GET https://api.carbonintensity.org.uk/regional/postcode/w7

Response:

    "error": {
        "code": "400 Bad Request",
        "message": "No postcode match can be found."
    }
}
@doig007
Copy link

doig007 commented Feb 13, 2021

Hi, I can't be any real help, but just on your first example there is no W1 postcode anymore.

W1A etc. seem to return matches:
https://api.carbonintensity.org.uk/regional/postcode/w1a

Nevertheless I concur that W2 etc. don't return a match which is very odd!

@mijiturka
Copy link

mijiturka commented Nov 25, 2023

From my testing so far it seems like results granularity is at the region level, but some postcodes in London are in region 12 ("South England") and some are in 13 ("London") . The same is true for Glasgow for example (it is usually in South Scotland, but has one postcode in North Scotland). If anyone else is looking at this or you still are, you may be better off just using region-wide endpoints and selecting the regions from https://carbon-intensity.github.io/api-definitions/?python#region-list after some experimentation with the return values of postcode-specific endpoints.

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

No branches or pull requests

3 participants