0

I need to parse this url http://www.google.com/trends/fetchComponent?q=swine&cid=TOP_QUERIES_0_0&export=3

I have tried with:

<?php
$ch = curl_init("http://www.google.com/trends/fetchComponent?q=swine&cid=TOP_QUERIES_0_0&export=3");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$html = curl_exec($ch);
curl_close($ch);
echo $html;
?>

But I receive only

You have reached your quota limit. Please try again later.

However if i can open that page from web browser (im not logged-in) and i can change search terms etc. So from web browser it works,, but id doesn't when using PHP and CURL.

RhymeGuy
  • 2,102
  • 5
  • 32
  • 62

1 Answers1

0

The answer is in the question: you've reached your quota for requests from Google Trends. Webmasters don't appreciate their websites being hammered by scripts performing automated requests. If you continue to send requests, many websites will block you from accessing them. The solution is either to slow down your requests to a more reasonable rate, to use the API (if available), to contact the webmaster to request an API be provided, or to get the data from elsewhere.

i alarmed alien
  • 9,412
  • 3
  • 27
  • 40
  • 2
    Im not running 10000 requests per second. I receive that error instantly or on second request from CURL. So to clarify, i can request mentioned page via CURL every 10-20-30minutes or so, but in the same time i can made multiple requests from browser (manually). – RhymeGuy Sep 21 '14 at 12:30