I am trying to fetch all records related to presto from Hacker News using their API that is built on top of Algolia Search API. And when I make this simple request
https://hn.algolia.com/api/v1/search?query=presto&hitsPerPage=1000
I get weird pagination results
values."nbHits":3977,"page":0,"nbPages":1,"hitsPerPage":1000,"exhaustiveNbHits":true,"exhaustiveTypo":true,"exhaustive":{"nbHits":true,"typo":true},"query":"presto","params":"advancedSyntax=true\u0026analytics=true\u0026analyticsTags=backend\u0026hitsPerPage=1000\u0026query=presto","processingTimeMS":73,"processingTimingsMS":{"afterFetch":{"format":{"highlighting":45,"total":54},"total":70},"fetch":{"total":3},"total":73}}
I see that number of hits is 3977, but that there is only 1 page with 1000 results. Not sure how to fetch all 3977 results, I tried setting page 2 but no results there.
What I am doing wrong?
Related
I have started using facebook API and I have noticed something strange.
I want to make a list with all the people in the guest list of the event: https://www.facebook.com/events/1565045953740088/. As you can see the event has 25k that went to the event, 925 on the maybe status and 19k in the invited status, so a total of around 45k. Using the Graph API Explorer, I have used the following code to retrieve the names of all the people:
GET/v2.4/1565045953740088/attending?limit=5000
GET/v2.4/1565045953740088/declined?limit=5000
GET/v2.4/1565045953740088/maybe?limit=5000
GET/v2.4/1565045953740088/noreply?limit=5000
After scrolling through the pages, and copy-pasting all the results in an excel, the total number of people I am getting is somewhere around 39,839. I am missing around 5k of people. Am I missing something in the code I am using?
P.S. The reason for setting the limit to 5000 and not to e.g. 25000 is because the page would freeze.
Some people can have disabled the Graph API integration for their Facebook account. That means that you will never be able to retrieve information from them; for example their attendance for Events. They are simply ignored from the responses. This could explain for the few thousand people you are missing.
From your side, there is no workaround for this.
I have a Facebook app, and I'd like to allow my users to invite their Facebook friends to my app. The proper endpoint is /me/invitable_friends which is working well. But towards the bottom of that doc page, they recommend implementing a "search box" to filter the results, yet they don't offer any example of how to do this. I've searched around and haven't found anything.
It doesn't appear as though you can pass additional params for filtering the results. Obviously I can filter the results after the fact, but that's not scalable since the API only returns ~20 users at a time. That limit is modifiable (I believe), though it's of course not wise to bump it too high.
So how can I build a search box interface if I can't pass the search text to the endpoint? I must be missing something.
Thanks in advance.
PS - I'm using the JS SDK.
You should probably file a bug.
Based on the documentation the default size is 1000 records (average Facebook friend list size is 300-400)
If you don't see the next parameter at the end of the result under paging then there are no more results.
According to the SoundCloud API documentation I should be able to specify filter=streamable on a search against tracks and (presumably) only get replies that are streamable. It's not working.
https://api.soundcloud.com/tracks.json?q=diddy&filter=streamable&client_id=<CLIENT_ID>
That returns some results that aren't streamable. Filtering the results myself is not desirable because I'm trying to fetch pages of a certain size.
I need a solution in graph api or fql to search a specific keyword for last 7 days or a way to count the no of total search results.
Right now,
I am applying a heavy limit. It works if result is single page, but fails on pagination.
http://graph.facebook.com/search?type=post&q=wonders&since=2012-01-13&limit=99999999999999
I want to gather data for statisticall purposes.
The pagination issue is a current bug listed http://developers.facebook.com/bugs
Per Jashwant's comments below, he has found that the API limits 500 per request and there's no way around this designed limitation.
I'm using Data api of google to get data in my filters, I'm getting data for page path for single page and I'm stuck at multiple pages. I followed document and passed following query to filters,
$filter = 'ga:pagePath=~/about_us.htm,ga:pagePath=~/index.htm';
Is there anything wrong in it? Can someone please help in it.
You need to add $dimensions='ga:pagePath' to individually query the two pages.
I don't see anything wrong with it but it's always good to run your data api calls through the Data Feed Query Explorer. It will show you if it is getting results and show you the proper url-encoded query.
I ran a query using the Data Feed Query Explorer on my site that was similar to yours and had no problems.