Page 1 of 1

F@H API not finding certain users

Posted: Fri Mar 10, 2017 5:27 pm
by Eegras
I've noticed something... interesting about the F@H API. If I were to search for myself ( started folding ~24h ago ) I cannot find myself. I have tried with both ?name= and ?passkey= and provided the proper passkey.

Example: /stats/api/donors?name=Eegras%5BPCMR%5D

If I use the API to get my donor page explicitly ( not searching ) it finds me no problem.

Example: /stats/api/donor/Eegras%5BPCMR%5D

Our use-case is we want to start trying to funnel more people in our community to using F@H so have come up with a way to reward our Folders with a special flair on Reddit. We are going to do this by requesting our Folders provide their Passkey to a site we've made, but I can't test because my passkey isn't finding my user.

By default /api/donors returns only the top 100 users, but a user by the name of PedroPCMR is not in the top 100 but shows up in the search ( /stats/api/donors?name=PedroPCMR ). PedroPCMR shared with me his passkey to test and I am able to use his passkey to find his user.

Re: F@H API not finding certain users

Posted: Sat Mar 11, 2017 1:51 am
by bollix47
Part of why a search for Pedro works and your's does not may be caused by the brackets that you're using ... the only valid folding name characters allowed are a-z 0-9 and the underscore:
http://folding.stanford.edu/home/faq/#ntoc31

The fact that they work on a direct lookup does not necessarily mean they'll work on a search. This is why they are considered invalid.

Re: F@H API not finding certain users

Posted: Sat Mar 11, 2017 9:48 am
by foldy
But this really looks like a bug in the web search API. You can register user names with brackets [] then the search should also find them.

Re: F@H API not finding certain users

Posted: Sat Mar 11, 2017 1:42 pm
by Eegras
I originally thought it was the brackets as well, but http://folding.stanford.edu/stats/api/d ... ame=Eegras doesn't find a user but http://folding.stanford.edu/stats/api/donor/Eegras does. It's very strange.

Re: F@H API not finding certain users

Posted: Sun Mar 12, 2017 1:21 pm
by Eegras
I have now placed in the top 1,000 of my folding team and searches for me work. Less than ideal, but I think we can work with it. Ideally I'd expect the API to show everyone.

Re: F@H API not finding certain users

Posted: Sun Mar 12, 2017 1:38 pm
by ChristianVirtual
how about just read the stats file ... download and scan it with all donors/team in ...

Re: F@H API not finding certain users

Posted: Mon Mar 13, 2017 3:03 pm
by Eegras
ChristianVirtual wrote:how about just read the stats file ... download and scan it with all donors/team in ...
That doesn't show the user's Passkey, for obvious reasons, and it will be useless if the user's Folding username and their Reddit username are different.

Re: F@H API not finding certain users

Posted: Wed Mar 15, 2017 2:32 pm
by Eegras
I found interesting behavior around this. The API's search methods only appear to look for people who place within the top 1000 of any of their teams they contribute to.