PHP Classes

KeywordTool Client: Get search engines keyword volume and suggestions

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 415 All time: 6,449 This week: 455Up
Version License PHP version Categories
keywordtool-client 1.0.1MIT/X Consortium ...5.5PHP 5, Web services, SEO
Description 

Author

This package can get search engines keyword volume and suggestions.

It can send HTTP requests to the KeywordTool API Web server to request information about the volume of searches performed in different search engines for a given keyword.

Currently it supports the search engines: Google, YouTube, App Store and Bing.

It can also return keyword suggestions that may auto-complete the given keywords, filtering by country and language, exclude certain keywords, return CPC and AdWords competition data.

Innovation Award
PHP Programming Innovation award nominee
March 2016
Number 13
Using the right keywords may make a great difference when you are creating content to optimize for better rankings in search engines.

This class can get keyword suggestions for related keywords using the KeywordTool API. It can get information on search volume, so you can have an idea of what keywords can bring more traffic.

Manuel Lemos
Picture of Oleksii Mylotskyi
  Performance   Level  
Name: Oleksii Mylotskyi is available for providing paid consulting. Contact Oleksii Mylotskyi .
Classes: 2 packages by
Country: Ukraine Ukraine
Age: 37
All time rank: 326852 in Ukraine Ukraine
Week rank: 215 Up3 in Ukraine Ukraine Up
Innovation award
Innovation award
Nominee: 1x

Documentation

Build Status Scrutinizer Code Quality Code Climate Coverage Status Dependency Status Total Downloads

Object Oriented keywordtool.io API Client

It is implementation of public API for the keywordtool.io, it can be reviewed here http://keywordtool.io/api/documentation

To start you will need to have an API key, which will be send to your EMAIL or you will be able to get it after login in tab API.

Quick start

Example using google keywords:

require './vendor/autoload.php';

// Keyword which you want to research
$keyword = 'iOS';

// Trying to get all keywords related to the keyword with volume metrics
// usage country is United States (google.com) and language English
// full list of available countries and languages you can found http://keywordtool.io/api/documentation
$request = \KWTClient\RequestFactory::google($keyword)->metrics(true)->country('us')->language('en');

$client = new \KWTClient\Client('[YOUR-API-KEY]');
$response = $client->research($request);

// will display
// Array
// (
//     [0] => Array
//         (
//             [kw] => ios
//             [vol] => 74000
//         )
//    ....

print_r($response->getKeywords());

But service provide you possibilities to get youtube, appstore and bing keywords suggestions.

For youtube:

....
$request = \KWTClient\RequestFactory::youtube('iOS');
....

For appstore:

....
$request = \KWTClient\RequestFactory::appstore('iOS');
....

For bing:

....
$request = \KWTClient\RequestFactory::bing('iOS');
....

Supported params for request returned from RequestFactory

country($countryCode = 'us')

Country to looking for keyword suggestions. On example, if you will declare $countryCode = 'ar' for Argentina, it will looks for keywords searched via google.com.ar List of country codes for different services available here http://keywordtool.io/api/documentation - Supported values for "country" parameter

language($language = 'en')

Language of the keyword suggestions. List of language codes for different services available here http://keywordtool.io/api/documentation - Supported values for "language" parameter

excludeKeywords(array $keywords = [])

Use this parameter to specify negative keywords, i.e. the keywords that you want to exclude from your results. For example, an API call that contains "keyword=iphone&exclude=case|game|price" will return keyword suggestions for the keyword "iphone" but there will be no keyword suggestions that contain words "case", "game", or "price". Meaning the keyword suggestion "best iphone price" will not show up in the results.

metrics($flag = false)

Allows to get Search Volume, CPC and AdWords Competition data for keywords in English language if this parameter is set to "true".

type($type = 'suggestions')

Type of search query. Available types are: "suggestions" and "questions".

complete($flag = false)

Allows to get the full set of autocomplete results. Please note that certain percent of requests might return an error if this parameter is set to "true".

Contribution

Wellcome to add anything you want to this Client. You just need to run unit tests, to make sure that your commit will not brake Client. And please write unit tests for your pull requests.

composer install --dev
./vendor/bin/phpunit --testsuite=unit

References

Full API documentation can be located http://keywordtool.io/api/documentation

License

Use this guide. Attributions are appreciated.

Copyright

Copyright (c) 2014-2016 Oleksii Mylotskyi

(The MIT License) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


  Files folder image Files (22)  
File Role Description
Files folder imagesrc (4 files, 3 directories)
Files folder imagetests (2 directories)
Accessible without login Plain text file .coveralls.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (22)  /  src  
File Role Description
Files folder imageException (3 files)
Files folder imageRequest (2 files)
Files folder imageResponse (2 files)
  Plain text file Client.php Class Class source
  Plain text file ExceptionInterface.php Class Class source
  Plain text file RequestFactory.php Class Class source
  Plain text file Utils.php Class Class source

  Files folder image Files (22)  /  src  /  Exception  
File Role Description
  Plain text file ApiException.php Class Class source
  Plain text file ExceptionFactory.php Class Class source
  Plain text file SearchLimitException.php Class Class source

  Files folder image Files (22)  /  src  /  Request  
File Role Description
  Plain text file Request.php Class Class source
  Plain text file RequestInterface.php Class Class source

  Files folder image Files (22)  /  src  /  Response  
File Role Description
  Plain text file Response.php Class Class source
  Plain text file ResponseInterface.php Class Class source

  Files folder image Files (22)  /  tests  
File Role Description
Files folder imageresources (1 directory)
Files folder imageunit (2 files, 2 directories)

  Files folder image Files (22)  /  tests  /  resources  
File Role Description
Files folder imagefixtures (1 file)

  Files folder image Files (22)  /  tests  /  resources  /  fixtures  
File Role Description
  Accessible without login Plain text file response_keyword_whatsapp_google.json Data Auxiliary data

  Files folder image Files (22)  /  tests  /  unit  
File Role Description
Files folder imageRequest (1 file)
Files folder imageResponse (1 file)
  Accessible without login Plain text file ClientTest.php Test Unit test script
  Accessible without login Plain text file RequestFactoryTest.php Test Unit test script

  Files folder image Files (22)  /  tests  /  unit  /  Request  
File Role Description
  Accessible without login Plain text file RequestTest.php Test Unit test script

  Files folder image Files (22)  /  tests  /  unit  /  Response  
File Role Description
  Accessible without login Plain text file ResponseTest.php Test Unit test script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:415
This week:0
All time:6,449
This week:455Up