Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Hard to reach the api today ? #252

Closed
MrSimh opened this issue Sep 22, 2021 · 22 comments
Closed

Hard to reach the api today ? #252

MrSimh opened this issue Sep 22, 2021 · 22 comments

Comments

@MrSimh
Copy link

MrSimh commented Sep 22, 2021

Hello,

I run the api with this url for my little app : https://restcountries.eu/rest/v2/all?fields=name;population;capital;flag;region;alpha2Code

But today i have a lot of 502,503 and 504 error,
I am redirected here : http://countrylayer.com/rest/v2/all?fields=name;population;capital;flag;region;alpha2Code

Is anyone have the same ?

Thx

@egpotter
Copy link

There are more people complaining here #251. We also face the same

@amatosg
Copy link

amatosg commented Sep 22, 2021

you can use https://restcountries.com instead :) it's a clone of this project that is updated more often

@heychazza
Copy link

you can use https://restcountries.com instead :) it's a clone of this project that is updated more often

Is yours open sourced?

@amatosg
Copy link

amatosg commented Sep 22, 2021

yes, I keep the original license and it's available for free :)

@Vitaljok
Copy link

you can use https://restcountries.com instead :) it's a clone of this project that is updated more often

@amatosg, just to keep it honest for your potential new audience, you should mention that https://restcountries.eu/rest/v2/all and https://restcountries.com/v2/all are not compatible and have different field names.

So the one who wants to migrate to new API have also to modify his code, not just URL.

@amatosg
Copy link

amatosg commented Sep 23, 2021

I never said to "just change the URL", I pointed to the site with the documentation to use the API. If the docs are not clear, please let me know and I will make the amendments.

@heychazza
Copy link

you can use https://restcountries.com instead :) it's a clone of this project that is updated more often

@amatosg, just to keep it honest for your potential new audience, you should mention that https://restcountries.eu/rest/v2/all and https://restcountries.com/v2/all are not compatible and have different field names.

So the one who wants to migrate to new API have also to modify his code, not just URL.

Yeah, I realised that… I ended up forking the original url, and using the dist countries.json file in my app

@amatosg
Copy link

amatosg commented Sep 23, 2021

If you just need the json file, I get it from here :)

@heychazza
Copy link

If you just need the json file, I get it from here :)

I’m currently using https://github.com/octanna/restcountries/blob/master/src/main/resources/countriesV2.json as it’s the exact data structure that the restcountries.eu was using.

No other api including yours contains population, and the JSON Object Structure is completely different.

@amatosg
Copy link

amatosg commented Sep 23, 2021

I have a V2 with almost the same structure (I added a png file for the flag) as this project which also includes population:

https://restcountries.com/v2/name/Eswatini

@heychazza
Copy link

I have a V2 with almost the same structure (I added a png file for the flag) as this project which also includes population:

https://restcountries.com/v2/name/Eswatini

Is it possible to have the same structure as the .eu API on your domain, but with the ability to see all countries? And PNG for flag is awesome.

@amatosg
Copy link

amatosg commented Sep 23, 2021

yeap :) almost all the functionallity available here is also available in V2 (Although I think I made the mistake of changing the URL structure)

https://restcountries.com/v2/all

@heychazza
Copy link

yeap :) almost all the functionallity available here is also available in V2 (Although I think I made the mistake of changing the URL structure)

https://restcountries.com/v2/all

Hey buddy, most of this seems perfect, only issue I see is;

  • subregion is now region.
  • region is now continent.

These are perfectly fine, but mainly for others to consider, only issue I see is that some things don't have a region key, could these be present but just null?

@amatosg
Copy link

amatosg commented Sep 23, 2021

I've created an issue here to keep track of what you mention.

I just went through the file and found only a couple of cases in which region was not set but was present as empty. Could you tell me which country does not have the region field?
thanks!

@dhernandez-applaudo
Copy link

dhernandez-applaudo commented Sep 23, 2021

@amatosg Hi there, I test your v3 solution and I found some issues in some calling codes, for example Mexico, its calling code is 52 but the API returns 484, insted I tested your v2 and I believe the returning information is more trusthy, thanks for telling us abut your solution, hope the project continue and keep growing.

@amatosg
Copy link

amatosg commented Sep 23, 2021

@dhernandezmartinez I'm sorry, but I just checked and V3 doesn't have calling code. It has a composite code called "idd" and it is actually 52 :/

@MrSimh
Copy link
Author

MrSimh commented Sep 24, 2021

hello

unfortunatly v2 and v3 are not compatible
v2 flags links are unreachable too

And if i take and recode for the v3, i will have to recode again for the v4 ?
I just need a json, up to date, and compatible to work with my little app.
If possible, without creat mine in local with all flags and names. and [fields i need] to bypass the issue

have a good day

@heychazza
Copy link

hello

unfortunatly v2 and v3 are not compatible
v2 flags links are unreachable too

And if i take and recode for the v3, i will have to recode again for the v4 ?
I just need a json, up to date, and compatible to work with my little app.
If possible, without creat mine in local with all flags and names. and [fields i need] to bypass the issue

have a good day

Yeah, I am finding his API is all over the place, best bet is to get the JSON file from the existing repo and reference that for your application.

@amatosg
Copy link

amatosg commented Sep 24, 2021

unfortunatly v2 and v3 are not compatible

Well, they're obviously not compatible, hence the version number in order to avoid braking implementations.

v2 flags links are unreachable too

They are reachable

And if i take and recode for the v3, i will have to recode again for the v4 ?

Yes. That will apply to every API you consume.

I just need a json, up to date, and compatible to work with my little app.

You can download the json file to your project and consume it

I am finding his API is all over the place

Sorry about that, I will try to make it better. If you have any specifics, I would love to hear them

@MrSimh
Copy link
Author

MrSimh commented Sep 24, 2021

yes i will find a way
for flags its ok i found https://restcountries.com/data/afg.svg is ok,i had https://restcountries.eu/data/afg.svg
thx

@amatosg
Copy link

amatosg commented Sep 25, 2021

@heychazza Hi Charlie, what do you mean with is all over the place?

@ePascalC
Copy link
Collaborator

Message from apilayer support: We no longer support restcountries.eu; however, we do offer a free tier of a similar API on countrylayer.com. See https://countrylayer.com/documentation/

meta72 added a commit to meta72/restcountries that referenced this issue Oct 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants