Closed mwierzbinski closed 1 month ago
We do not support field filtering anymore on the API. It was barely used and decided to scrap that feature off during a rewrite of the API.
From the top of your head, do you find any particular case on which this feature would be useful?
I think the only reason to use it is to limit the response size. In my case I was using your API for a mobile app and there was just a lot of information that its not necessary. I don't think it's crucial feature in any way.
I do have a question, is it possible to pass location as a parameter and get list sorted by nearest station?
Also can you retrieve stations in a sorted way? i.e by name?
I do have a question, is it possible to pass location as a parameter and get list sorted by nearest station?
As in, on a specific network or any network?
Also can you retrieve stations in a sorted way? i.e by name?
In general, we decided to not provide these shortcuts that should be easily done on the client. Getting nearest station from any network is arguably different and we might provide that, but to sort a list of lat lngs on a network, to a particular lat,lng is easy to do. See https://github.com/eskerda/python-citybikes/blob/af7b7525d79e7d9f1e480b222bd452b35e8a95e1/citybikes/utils.py#L1-L25
If possible, we prefer to not deal at all with client lat/lng for privacy purposes.
@mwierzbinski I have updated the API to accept field filtering again. Give it a try and let me know if it works for you
https://api.citybik.es/v2/networks?fields=name,location.latitude,location.longitude,href https://api.citybik.es/v2/networks/bicing?fields=name,stations.free_bikes,stations.empty_slots,stations.extra.uid
During testing the api I noticed that the filter feature is not working:
When I try to send url with fields I'm getting the same results as without parameters.