Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8639643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:04:13+00:00 2026-06-12T11:04:13+00:00

I am trying to build a web site where a user can enter their

  • 0

I am trying to build a web site where a user can enter their web site and check their indexed pages in Google.
Just like we do by site:domain.com.

I am using a Google API, here is the link to API (I know it’s deprecated):

http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=

When I use a code like:

<?php  

function getGoogleCount($domain) {
    $content = file_get_contents('http://ajax.googleapis.com/ajax/services/' .
        'search/web?v=1.0&filter=0&q=site:' . urlencode($domain));
    $data = json_decode($content);
    return ($data->responseData->cursor->estimatedResultCount);
}

echo getGoogleCount('stackoverflow.com');

?>

It is good as far as I want to know about the result counts,
but the next thing I want is to list all the results on my we bsite. I am unable to grab the results because when we write:

$data->responseData->cursor->estimatedResultCount

It goes straight,
but when we try to get results. I don’t know how to do it, just to print the idea:

$data->responseData->results->[url & title & content here]

Because here results is an array, and I don’t know how can I store info in an array in this case.

Have been searching for a long time but can’t find anything related…..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:04:14+00:00Added an answer on June 12, 2026 at 11:04 am

    The easiest way is to use:

    $data = json_decode($content, true);
    

    That will convert objects to normal associative arrays which are probably easier to handle.
    Then you access your values by something like this:

    $results = $data['responseData']['results']; //array
    $googleCount = $data['responseData']['cursor']['estimatedResultCount'];
    

    Then with the results you can do something like this:

    foreach ($results as $result) {
        echo $result['title'].' -> '.$result['url'] . '<br />';
    }
    

    But of course if you don’t like associative arrays and you prefer objects, you could do it also this way:

    $data = json_decode($content);
    foreach ($data->responseData->results as $result) {
        echo $result->title .' -> '.$result->url.'<br />';
    }
    

    If you want to check which properties has the $result, just use print_r or var_dump.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to build a site where you can install Drupal through a web
I am trying to build a db driven web site in which the user
I'm essentially trying to do the following on a Java/JSP-driven web site: User supplies
I'm trying to build a mobile HTML5 webapp in which user can click on
I am trying to build an application where a user can specify a URL
I am getting the error below when trying to build the web site project
Im new to WF and i'm trying to build an asp.net MVC web site
I am trying to build a shopping website with ajax. When a user clicks
I am trying to build a website where I can read the data from
I just ran into a problem.. I'm trying to build a website at the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.