Code Monkey home page Code Monkey logo

google-api-php-client-unlimited's Introduction

Google APIs Client Wrapper For PHP (free unlimited requests for google services)

Google APIs Client Wrapper for PHP with multi keys (for free using)

This extension has been developed to overcome the maximum number of requests to Google API services free of charge.

For example service Custom Search Engine (https://cse.google.com/cse/all). There are free of charge can only be made 100 requests per day ($ 5 - 1000 requests, etc.), which is very small, so it is now possible to create multiple applications and take each token, with the identifier of the application remains a CSE, that is, in other words - we can use every 100 requests from each application we have created. We simply create an application and take with them the ID.

And this method can be applied to any API, provided to reduce constraints.

Example:

// Custom Search Engine Example

// https://console.developers.google.com/project
// In total count all tokens eq 300 FREE requests/day! Ha-Ha!
$keys = array(
	'YOUR_DEVELOPER_KEY_1', // app-1, for one project available 100 free requests
	'YOUR_DEVELOPER_KEY_2', // app-2 + 100 requests
	'YOUR_DEVELOPER_KEY_3', // app-3 + 100 requests
	// ...
);

$client = new Google_Client_Multi();
$client->setKeys($keys)->prepareMulti();

$service = new Google_Service_Customsearch($client);
try {
	$cse = $service->cse->listCse("weather", array('cx' => 'YOUR_CUSTOM_SEARCH_ENGINE_ID'));
	var_dump($cse->getItems());
} catch(Google_Service_Exception $e) {
	echo $e->getMessage();
} catch(Google_Client_Multi_Exception $e) {
	echo $e->getMessage();
}

Install/Autoload

Composer:

This version of google-api-php-client-multi using Composer. The first step to use google-api-php-client-multi is to download composer:

$ curl -s http://getcomposer.org/installer | php

Now we can use autoloader from Composer by:

php composer.phar require 'igorbelikov/google-api-php-client-multi:dev-master'

or

{
    "require": {
		"igorbelikov/google-api-php-client-multi": "dev-master"
    }
}

RU

Это расширение было разработано для преодоления максимального количества запросов в сервисах Google API на бесплатной основе.

Например сервис Custom Search Engine (https://cse.google.com/cse/all). Там на бесплатной основе можно делать только 100 запросов в день (5$ - 1000 запросов и т.д.), что очень мало, поэтому теперь есть возможность создать несколько приложений и взять у каждого токен, при этом идентификатор самого CSE приложение остается один, то есть другими словами - мы можем использовать каждые 100 запросов из каждого созданного нами приложения. Нам достаточно просто создавать приложения и брать с них идентификатор.

И этот способ можно применить к любому API, чтобы уменьшить предоставленные ограничения.

google-api-php-client-unlimited's People

Contributors

igorbelikov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

google-api-php-client-unlimited's Issues

Doesn't work

Warning: Declaration of Google_Client_Multi::execute($request) should be compatible with Google_Client::execute(Psr\Http\Message\RequestInterface $request, $expectedClass = NULL) in /var/www/example.com/html/vendor/igorbelikov/google-api-php-client-multi/Google_Client_Multi.php on line 11

Fatal error: Uncaught Error: Cannot use object of type GuzzleHttp\Psr7\Response as array in /var/www/example.com/html/google-image-search.php:52 Stack trace: #0 {main} thrown in /var/www/example.com/html/google-image-search.php on line 52

large amount of results

Hey, may you help me with my own issue?
I'm trying to scrape large amount of results in Google, but I reach a limit of XXX with the message :

"In order to show you the most relevant results, we have omitted some entries very similar to the XXX already displayed.
If you like, you can repeat the search with the omitted results included."

I'm trying to get through 1000 results.
Any advises? clues?
Thanks ahead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.