Due to the new pagination of the /sites method in v1.1 of the API, we have to go through all the pages of sites to check whether a site exists, or allow the user to search for a site.
Would it be possible to provide a way to search the list instead?
Pagination on /sites is solely so [app]s don't have to pull down any unknown, large, and constantly growing chunk of a data in a single request.
It is expected that every consumer would grab all sites in a series of sequential (or concurrent, if they're comfortable with that) requests for each page.
For now, as we have only ~80 sites, you can set pagesize to 100 and get them all.
But in general, I think pagination here makes no sense at all. Because there're no search parameters or ordering, I can't think of a situation where app can fetch only first page and be satisfied.
Would it be possible to provide a way to search the list instead?
I would propose just getting the whole list of sites, caching it (as documentation recommends) and searching locally.
/sites results. I'm never going to want only some of the sites; I want all or nothing. cron script that runs every 24 hours, polls /sites, and sticks the results into a MySQL database. That way I can search, re-order, and do all manner of things with it.