API Call for getting torrent count

Other platforms, generic questions.
Post Reply
ElAdri1999
Newbie
Newbie
Posts: 3
Joined: Tue Oct 17, 2023 8:46 am

API Call for getting torrent count

Post by ElAdri1999 »

I have been checking the Wiki for the qBit API https://github.com/qbittorrent/qBittorr ... rrent-4.1) and i haven't been able to find a way to get the total count of torrents in /api/v2/torrents/info.

I am working in developing a working client for android, iOS and Windows to connect to one (or possibly multiple) qbit clients and my biggest issue right now is being loading the list of torrents for big counts, my main qbit client has over 7k torrents and any clients i have tried just time out before loading anything (mainly https://github.com/lgallard/qBittorrent-Controller) so i decided to make my own client.

Any help is very appreciated.

TLDR: Looking for a way to get a count of torrents via API
User avatar
Peter
Administrator
Administrator
Posts: 2702
Joined: Wed Jul 07, 2010 6:14 pm

Re: API Call for getting torrent count

Post by Peter »

I'd suggest just opening a ticket about this. It's just not in the API right now, but should be pretty easy to do. Just do a feature request and it should be implemented pretty fast I think. I mean obviously it depends on dev workload and whatnot but it sounds like a simple call to add.

Until then you could try tricks like ...
- get all the categories
- get all torrents by categories using filter
- count them all together

Doesn't help if the 7k torrents are all in the same category though. (:

I mean I have no clue about the inner workings of the API but I'd do like:
- make a "get total count" call that you are looking for
- introduce a new "limit" filter, which would do like a lower-upper limit
- I'd also make a new filter "lessData" and just omit magnetURI or even more data. because when I try the call, 99% of the size is just the magnetURI of all my trackers and it sure adds up to megabytes even with just a bunch of torrents.

anyway, that's just my own ranting. open ticket and good luck!
ElAdri1999
Newbie
Newbie
Posts: 3
Joined: Tue Oct 17, 2023 8:46 am

Re: API Call for getting torrent count

Post by ElAdri1999 »

Peter wrote: Tue Oct 17, 2023 12:18 pm I'd suggest just opening a ticket about this. It's just not in the API right now, but should be pretty easy to do. Just do a feature request and it should be implemented pretty fast I think. I mean obviously it depends on dev workload and whatnot but it sounds like a simple call to add.

Until then you could try tricks like ...
- get all the categories
- get all torrents by categories using filter
- count them all together

Doesn't help if the 7k torrents are all in the same category though. (:

I mean I have no clue about the inner workings of the API but I'd do like:
- make a "get total count" call that you are looking for
- introduce a new "limit" filter, which would do like a lower-upper limit
- I'd also make a new filter "lessData" and just omit magnetURI or even more data. because when I try the call, 99% of the size is just the magnetURI of all my trackers and it sure adds up to megabytes even with just a bunch of torrents.

anyway, that's just my own ranting. open ticket and good luck!
My category with the most torrents has like 2200 items

My code right now loads torrents in batches of 20 every time you scroll to the bottom of the list

I didnt really find a way to omit fields in the API response, if i could i would limit it to name, state,size,hash and probably 2-3 more fields and then if you were to click the ListItem make the apicall to get the full details using the hash
Post Reply