Search code examples
phpgoogle-apigoogle-api-php-clientgoogle-custom-search

Google custom search: Looking for example of retrieving search results


Following the example written in here.

  1. How can I retrieve each of the search result URL, anybody has an idea?
  2. How can I limit the search result to lets say 5 results?

Solution

    1. How can I retrieve each of the search result URL, anybody has an idea?

    Here you find the description of the reponse object, the search result URLs are in items[].link

    1. How can I limit the search result to lets say 5 results?

    You can pass a "num" parameter

    enter image description here

    RTM :P