Page 1 of 1
New API statistics - based on passkey query
Posted: Sun Sep 26, 2021 5:24 pm
by wuffy68
Hey Community ... in the past, we were able to get statistics by passkey using the following api query:
Code: Select all
https://stats.foldingathome.org/api/donors?passkey=<passkey>
Since this is no longer available, is there a way to get passkey-specific queries using the new api query:
I've tried several variations of the old query with the new search, but have been coming up empty.
Thank you!
Re: New API statistics - based on passkey query
Posted: Tue Sep 28, 2021 10:57 am
by mapachita
I don't know if it'll help, but I've been using
Code: Select all
https://api.foldingathome.org/api/donor/[userid]
and
Code: Select all
https://api2.foldingathome.org/api/donor/[userid]
both api. and api2. seem to return exactly the same thing.
The JSON is formatted a bit differently, eg. "total_users" is now "users" and "credit" is now "score"
Going to
https://api.foldingathome.org/ with a web browser will give you documentation.
It shows
Code: Select all
curl -G https://api.foldingathome.org/user/name -d passkey=<string>
curl -G https://api.foldingathome.org/user/name/stats -d passkey=<string>
curl -G https://api.foldingathome.org/bonus -d user=<string> -d passkey=<string>
among other things.
I'm not at all an expert, though.
Re: New API statistics - based on passkey query
Posted: Tue Sep 28, 2021 2:03 pm
by aetch
Just a hunch, they might be using a passkey with a variety of usernames.
I believe there's some folders who will assign each of their systems a different username to keep track of that system's progress. Using a common passkey keeps the download simple as your only making one request for all the usernames instead of a request for each username.
Re: New API statistics - based on passkey query
Posted: Tue Sep 28, 2021 2:50 pm
by Joe_H
Due to performance issues with the stats database, some of the API calls are currently blocked except when they come from a client. From what I understand, Web Control requests for stats that request based on username and passkey get results. Work is being done on this, but I don't know when it will be completed and which API calls will be fully supported.
Re: New API statistics - based on passkey query
Posted: Sat Oct 16, 2021 6:49 am
by wuffy68
mapachita wrote:
Code: Select all
curl -G https://api.foldingathome.org/user/name -d passkey=<string>
curl -G https://api.foldingathome.org/user/name/stats -d passkey=<string>
curl -G https://api.foldingathome.org/bonus -d user=<string> -d passkey=<string>
Thank you! I finally broke down and installed curl (was using http requests in a browser which require a little extra finess)
Yes, some of the output parameters in JSON aren't consistent (earned vs score), however; these appear to get me very close.
Still having trouble getting the right API combo that would also include total wu's per passkey/username as well, since I want to make sure those with private passkeys generate at least 10 work units for our team-within-a-team account.
Re: New API statistics - based on passkey query
Posted: Sat Oct 16, 2021 7:04 am
by wuffy68
aetch wrote:Just a hunch, they might be using a passkey with a variety of usernames.
... this is for a club-within-a-team user account ...
We want to track individual contributions to a single user account, to see if they've submitted at least 10 WU's to earn the bonus PPD for the main user account - proving they've given it some effort - since bonus PPD are earned based on passkeys, not at the user account itself.
This also helps weed out bad actors from the "club" - say if an individual dumps work units frequently, their club-assigned passkey will be sanctioned by the work servers, but the club user account will remain in good standing (at least theoretically).