Fix: Switch to restcountries v3 API and use common country name #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's changed:
Related Issues:
Description:
This is a temporary, easy workaround fix for the issue #148.
However, although it should resolve the mismatch for the reported countries, it is important to note that this fix may not work for all countries as the process of joining data from different APIs based on country names is not reliable.
To elaborate, in our squid processor, we fetch cities from the repository available at https://raw.githubusercontent.com/shivammathur/countrycity/master/data/geo.json and countries from the https://restcountries.com/ API. We then join these data based on the country name. Similarly, in the Gridproxy, we fetch node data from the chain and county data from GraphQL and join it based on the country name.
This process is not always accurate as there are often alternative spellings for country names. Hence, unless you are using the same data source, it's not guaranteed to find a match.
To properly resolve this issue, I suggest using the same API or a more unique identifier such as country code. However, this would require changes in different services.