API feature request

Posts: 1 · Views: 84
  • 27928

    As I am currently developing a Python wrapper for the API, I've came across two things that, in my opinion, could be improved to make the development and the user's experience a bit nicer.

    1. When fetching a collection, we can do so in two ways: public collections by passing an username; or all collections (public and private) by passing an API key. The problem lies in viewing the listing of a collection. To access the listing of a collection, both the username of the collection's owner and the ID of the collection is required. The problem is that, in my wrapper, if the user uses an API key to fetch collections, they would have to manually input the username to view the listing of collections they've fetched already. The easiest solution, in my opinion, would be to return the username of the collection's owner in the response, inside the collection object. That way, my collection models will have access to both the ID and the username. Another solution, albeit one that is harder to implement and more bug-prone, would be to simply remove the username from the URL, therefore allowing us to fetch collections by only supplying the collection's ID. However, since there should be reasons for the API to not have been designed this way, I think the first solution would be preferred.

    2. When searching for wallpapers, it's quite a chore finding out exactly which search parameters were used. My biggest problem is that, if an API key is present and no additional parameters were supplied, then the only way for me to know exactly which parameters were used is to send another request to access the user's browsing settings. That is not ideal. The simplest solution would be to add these parameters to the response, more specifically inside Meta. Since I provide a way for the users to interact with the search parameters, this would help me and the users quite a lot, more so when interacting with said parameters to filter the listing to their liking.

    In conclusion, returning the username and the search parameters in the response should not require any major restructuring of the API, yet these changes would bring quite a lot of benefits, I would say.

Message