In T318512#8313264, @Durotimi-Hector wrote:In T318512#8310278, @Slst2020 wrote:In T318512#8310162, @Durotimi-Hector wrote:@Caseyy0000 can you please shed more light on 'pagination' i just ran into the same set of problems. thank you
Experimenting with the /tools endpoint using the API docs https://toolhub.wikimedia.org/api-docs#get-/api/tools/ could help you understand this.
The page you request from the endpoint must be passed as a query parameter. If not specified, it defaults to page=1. The URL for page 2 would then be "https://toolhub.wikimedia.org/api/tools/?page=2"
Thanks you @Slst2020 .
However, i noticed i'm not able to pull more than 1000 tools from the database, even when i set the query to go over and a code probing the db for tool count returns more than 2000 tools
url = f"https://toolhub.wikimedia.org/api/tools/?ordering=name&page={query_page}&page_size=1050"
where the query_page is 1.
my attempt to work around was to loop through page param, still wont exceed the 1000 result.
while query_page != 5: url = f"https://toolhub.wikimedia.org/api/tools/?ordering=name&page={query_page}&page_size=1050" ...The missing facet shows that there are over 1500 tools with missing fields.
any help pleasw
- Feed Queries
- All Stories
- Search
- Feed Search
- Transactions
- Transaction Logs
Feed Search
Oct 13 2022
Oct 13 2022
Oct 11 2022
Oct 11 2022
I Have a question on Task Set 2, I have used both the api/tools/ and api/search/tools/ endpoints and I am obtaining only 10 tools from the results, aren't the tools more than that? or are we to use the api/search/lists/ endpoint
when parsing through the annotations dict, i use:
for key, values in x.items(): if values: pass else: list.append(key)The problem howerver is that fields with boolean values of 'False" would evaluate to false and considered missing.
any suggestions on how to work around this?
Content licensed under Creative Commons Attribution-ShareAlike (CC BY-SA) 4.0 unless otherwise noted; code licensed under GNU General Public License (GPL) 2.0 or later and other open source licenses. By using this site, you agree to the Terms of Use, Privacy Policy, and Code of Conduct. · Wikimedia Foundation · Privacy Policy · Code of Conduct · Terms of Use · Disclaimer · CC-BY-SA · GPL · Credits