PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » Services_Google » Manual

Provides access to the Google SOAP Web APIs

Introduction

Introduction – Introduction to Services_Google

Introduction to Services_Google

Services_Google allows easy access to the Google SOAP APIs for the search engine, spelling suggestions, and cache.

In order to use this package you will need to register for an API key.

Please note that as of December 5, 2006, Google is no longer issuing new API keys for the SOAP Search API.

Services_Google enables you to search, spell checks and get cached pages from Google's cache by using a Services_Google class that provides functions like search(), spellingSuggestion() or getCachedPage().

Example

Example – Basic examples of Services_Google

Basic examples of Services_Google

The following examples show how to use some basic features of Services_Google:

Search Google for PEAR

<?php
require_once 'Services/Google.php';
    
$google = new Services_Google($key);

$google->queryOptions['limit'] = 30;
$google->search("PEAR");

foreach ($google as $key => $result) {
  echo "$key]\t$result->title\n";
}
?>

Spell Checking

<?php
require_once 'Services/Google.php';
    
$google = new Services_Google($key);

echo $google->spellingSuggestion("wahll")."\n";
?>