MartinsOnuoha / countriesNowAPI

CountriesNow is an Open source API for retrieving geo-information for countries, including their states, cities, population, etc. 🌎
http://countriesnow.space
MIT License
179 stars 55 forks source link

Not able to get country, capital and flag using the filter #157

Closed SiddharthRana closed 6 months ago

SiddharthRana commented 7 months ago

How can we get country name, capital and flag in the response. capital query is not working on filter. Could you please help?

MartinsOnuoha commented 6 months ago

Can you point what endpoint you're referring to?

SiddharthRana commented 6 months ago

https://countriesnow.space/api/v0.1/countries/info?returns=name,flag,capital

I cant get the capital using api like this. I want to get only 3 informations i.e. name, flag and capital. Can i do that?

MartinsOnuoha commented 6 months ago

Hi @SiddharthRana, You can already get name and flag by making a get request to the endpoint and passing both params. However, we didn't have support to query capital, but I have opened a merge request to fix that. You should now be able to get the capital by also passing the capital query param.

/info?returns=name,flag,capital