Download the PHP package aleszatloukal/google-search-api without Composer

On this page you can find all versions of the php package aleszatloukal/google-search-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-search-api

GitHub version GitHub license [Packagist]()

Google API Search Engine

Laravel package to get Google Custom Search results from Google Custom Search Engine API for both free and paid version.

Installation

Add aleszatloukal/google-search-api to composer.json.

Run composer update to pull down the latest version.

Or run

Now open up /config/app.php and add the service provider to your providers array.

Now add the alias.

Configuration

Run php artisan vendor:publish --provider="AlesZatloukal\GoogleSearchApi\GoogleSearchApiProvider" and modify the config file with your own information.

With Laravel 5, it's simple to edit the config.php file - in fact you don't even need to touch it! Just add the following to your .env file and you'll be on your way:

Creating your custom search engine

  1. If you create your engine at https://cse.google.com/cse/ you will find the ID after you click at Settings
  2. Just check the URL you have like https://cse.google.com/cse/setup/basic?cx=search_engine_id and the string after cx= is your search engine ID

!! Attention !! If you change style of your Custom search engine, the ID can be changed

Get your API key

  1. go to https://console.developers.google.com, than
  2. click on the menu on the right side of the GoogleAPI logo and click on 'Create project'
  3. enter the name of the new project - it is up to you, you can use 'Google CSE'
  4. wait until project is created - the indicator is color circle on the top right corner around the bell icon
  5. API list is shown - search for 'Google Custom Search API' and click on it
  6. click on 'Enable' icone on the right side of Custom Search API headline
  7. click on the 'Credentials' on the left menu under the 'Library' section
  8. click on the 'Create credentials' and choose 'API key'
  9. your API key is shown, so copy and paste it here

Usage

Simple usage

Create an object and call the function getResults to get first 10 results

Do not forget to map namespace with, so sample controller will look like this (in min. way)

It is only example controller name, you can use whatever you want, this is notice mainly for novices in Laravel

You can also get information about the search like total records and search time

Advanced usage

You can use any parameter supported at Google. List of parameters is here: https://developers.google.com/custom-search/json-api/v1/reference/cse/list#parameters

E.g. you want to get next 10 results

You can also get the raw result from Google including other information Full list of response variables is available here: https://developers.google.com/custom-search/json-api/v1/reference/cse/list#response

For getting the number of results only use

If you have more engines / more api keys, you can override the config variables with following functions

License

This package is open-sourced software licensed under the MIT license


All versions of google-search-api with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version >=5.0.0
php Version >=7.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aleszatloukal/google-search-api contains the following files

Loading the files please wait ....