New API statistics - based on passkey query

Moderators: Site Moderators, FAHC Science Team

Post Reply
wuffy68
Posts: 168
Joined: Wed Jun 04, 2014 11:06 pm
Hardware configuration: 1x nVidia 1080Ti, 1x nVidia 1070, 1x nVidia 1060, 1x nVidia 750Ti, AMD Radeon R7 M460
Location: Roxborough, Colorado USA
Contact:

New API statistics - based on passkey query

Post 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:

Code: Select all

https://api2.foldingathome.org
I've tried several variations of the old query with the new search, but have been coming up empty.

Thank you!
1x nVidia 1070, 1x nVidia 1060 3g,
1x nVidia 970, 2x nVidia 960,
1x nVidia 555, 1x AMD R7, 2x AMD 295,
6x i5 CPU-only rigs
mapachita
Posts: 3
Joined: Thu Sep 10, 2020 6:58 am

Re: New API statistics - based on passkey query

Post 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.
aetch
Posts: 436
Joined: Thu Jun 25, 2020 3:04 pm
Location: Between chair and keyboard

Re: New API statistics - based on passkey query

Post 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.
Folding Rigs - None (25-Jun-2022)

ImageImage
Joe_H
Site Admin
Posts: 7927
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: New API statistics - based on passkey query

Post 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.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
wuffy68
Posts: 168
Joined: Wed Jun 04, 2014 11:06 pm
Hardware configuration: 1x nVidia 1080Ti, 1x nVidia 1070, 1x nVidia 1060, 1x nVidia 750Ti, AMD Radeon R7 M460
Location: Roxborough, Colorado USA
Contact:

Re: New API statistics - based on passkey query

Post 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.
1x nVidia 1070, 1x nVidia 1060 3g,
1x nVidia 970, 2x nVidia 960,
1x nVidia 555, 1x AMD R7, 2x AMD 295,
6x i5 CPU-only rigs
wuffy68
Posts: 168
Joined: Wed Jun 04, 2014 11:06 pm
Hardware configuration: 1x nVidia 1080Ti, 1x nVidia 1070, 1x nVidia 1060, 1x nVidia 750Ti, AMD Radeon R7 M460
Location: Roxborough, Colorado USA
Contact:

Re: New API statistics - based on passkey query

Post 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).
1x nVidia 1070, 1x nVidia 1060 3g,
1x nVidia 970, 2x nVidia 960,
1x nVidia 555, 1x AMD R7, 2x AMD 295,
6x i5 CPU-only rigs
Post Reply