2

As there are 2 response format(Atom and Json) from Twitter search api, i am trying to fetch the twits(Json format) by using the URL:[http://search.twitter.com/search.json?q=pareshmayani], but you know it is returning only 1 page with 15 twits at a time(and yes its as per the twitter search API documentation) same as the below image:

enter image description here 1

But what if i want to fetch 2nd page of twits, i know i can use page querystring value such as http://search.twitter.com/search.json?q=pareshmayani&page=2, but when i use it, it returns me the below output:

enter image description here

Problem: So As you have noticed the above response, it should return 2nd page of 15 twits in response. Please give me suggestions if i am doing something wrong to fetch 2nd page of twits.

Thanx, Paresh

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295

1 Answers1

3

There is only one page of results.

If you search for a popular term, like cheryl cole, you will see a 'next_page' field returned in the JSON. This field contains a query string to retrieve the next page.

David Snabel-Caunt
  • 57,804
  • 13
  • 114
  • 132
  • Thanx for your great support. But you have also used the same URL which i have used, but in my case, next_page value is not being appeared. You can see the same problem in attached 1st image. – Paresh Mayani Jul 04 '11 at 10:51
  • 1
    There is no second page of results for your query. They key is to look in the first page of results. Inspect the JSON for my query and you will see next_page: "?page=2&max_id=87836354196680704&q=cheryl+cole". Another example is http://search.twitter.com/search.json?q=noresultsblahblah where there are no results at all, and no 'next_page' field. – David Snabel-Caunt Jul 04 '11 at 10:54
  • It should not be the case because i have done 399 tweets. But you know one thing i am getting only 15 tweets as per this twitter page: http://goo.gl/bCYAx , please find the message at the below side: " Older Tweet results for pareshmayani are unavailable." , so this may cause the problem. – Paresh Mayani Jul 04 '11 at 10:58
  • I have already done 399 tweets so far, so there should be next page, is there any settings we have to set to get next page of tweets? – Paresh Mayani Jul 04 '11 at 11:02
  • You're currently using the search API, you should probably want to use https://twitter.com/status/user_timeline/pareshmayani.json – David Snabel-Caunt Jul 04 '11 at 11:03