ITunes Search API page number for the query - ios

Is there any way to get results of next page of a search query? When I give page parameter, I get the same results from ITunes as:
https://itunes.apple.com/search?country=us&limit=200&entity=software&term=a
and
https://itunes.apple.com/search?country=us&limit=200&entity=software&term=a&page=2
gives the same output. Giving page parameter works for customer reviews.
Is there any way to get the results of next page?
According to API documentation there is no way but I found a lot of useful answers which are not indicated in API documentation.

I found a way to query more records. There is a parameter called offset, which is not mentioned in API documentation.
https://itunes.apple.com/search?term=a&offset=25&limit=25
Enjoy!

Actually there is no pagination in apple search API. It will only return maximum first 200 records.
Below is reference URL for same:
https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/#searching
Thank you.

Related

Why is the twitter list API not returning the correct number of results?

I'm using the twitter List API to get tweets from a set of accounts that I've added to a list. However, I'm noticing that for some reason I'm not receiving the correct number of tweets in the response from twitter. Here is my URL
https://api.twitter.com/1/lists/statuses.xml?list_id=68707107&per_page=30
I'm clearly asking for 30 results there, however if you just type that into a web browser you'll see it does not return 30 results. Does anyone know why this is?
Thanks!!
The per_page attribute it's an "up to" value. If you use the since_id you may get better results. And the pages in the api are being deprecated as you can read in the doc.
Work your solution using the since_id and max_id arguments in the api.
Check https://dev.twitter.com/docs/working-with-timelines
Check this answer: GET lists/statuses per_page returning unexpected results
Twitter may be limiting the number of tweets in requests to 20 so you could try downloading 20 and then load the next 10 after that.

limit results for Ask.com per URL parameter

I'm looking for an URL parameter to set the results per page on Ask (ask.com) search engine? For Google and Bing I found a parameter, but for Ask.com I get only some results for a Web Search API, but that's not what I'm looking for. Does anyone know, if there is a parameter like num=30 or so to display X results, like:
http://de.ask.com/web?q=something&qsrc=0&o=312&l=dir&num=30
Ok, found out, that this is not possible. So I have to grab next page on my own.

Is there a way to use since_id and max_id in Twitter's Search API?

I'm trying to get the search results between two specific id's but it seems to ignore the ids, here is a sample of my query:
http://search.twitter.com/search.json?since_id=58308825907871744&q=%23twitter&rpp=100&max_id=58309448581660674
It just throws back the same set of results if I change the ids. Any ideas?
Unfortunately, the search API doesn't support a max_id parameter. It features an until parameter instead, which is specified as a date rather than a status ID. So, you would have to reformat your query something like the following:
http://search.twitter.com/search.json?since_id=58308825907871744&q=%23twitter&rpp=100&until=2011-04-14
Twitter API issue 2052 details Twitter's response to the very issue that you raise.
Note that in v1.1 max_id is supported on the search api.
https://dev.twitter.com/rest/reference/get/search/tweets#api-param-max_id

Twitter: Number of tweets OR get more tweets

I would like to know how can I get all tweets from a certain hash tag?
I am currently using the following code:
xhr.open("GET","http://search.twitter.com/search.json?q=%23PrayForJapan");
This only returns me 15 tweets. Does anyone know how to make it return more?
Also, I have got a code to get me the tweets of a certain screen name, this only returns 20 tweets, how can i ask the following 20 tweets?
The code i used for that is:
xhr.open("GET","http://api.twitter.com/1/statuses/user_timeline.json?screen_name=Eminem");
I'm using titanium to create this, but I don't think that is an issue?
Thanks!
You can usually add count=x as parameter to the query string to get up to x tweets (for the search api it seems to be rpp). Query string parameters are added to the base url via ? and each individual parameter is then separated by & as in http://api?user=1&count=4
Most of the time, it is better though to remember the last tweets and then add ?since_id=x as this way you only get tweets you did not see before.
Have a look at the api documentation.

Twitter API - Display all tweets with a certain hashtag?

How would I go about displaying tweets that contain a certain hashtag using the Twitter API? Thanks
I'd also like to know if there is a way to get all tweets from a certain hashtag in a separate file, also the ones that don't show up in your feed anymore. I suppose that's what the earlier question was about, too.
This answer was written in 2010. The API it uses has since been retired. It is kept for historical interest only.
Search for it.
Make sure include_entities is set to true to get hashtag results. See Tweet Entities
Returns 5 mixed results with Twitter.com user IDs plus entities for the term "blue angels":
GET http://search.twitter.com/search.json?q=blue%20angels&rpp=5&include_entities=true&with_twitter_user_id=true&result_type=mixed
UPDATE for v1.1:
Rather than giving q="search_string" give it q="hashtag" in URL encoded form to return results with HASHTAG ONLY. So your query would become:
GET https://api.twitter.com/1.1/search/tweets.json?q=%23freebandnames
%23 is URL encoded form of #. Try the link out in your browser and it should work.
You can optimize the query by adding since_id and max_id parameters detailed here. Hope this helps !
Note: Search API is now a OAUTH authenticated call, so please include your access_tokens to the above call
Updated
Twitter Search doc link:
https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets.html
The answer here worked better for me as it isolates the search on the hashtag, not just returning results that contain the search string. In the answer above you would still need to parse the JSON response to see if the entities.hashtags array is not empty.

Resources