nao-30 / gtrends-php-sdk
A professional PHP SDK for the Google Trends CLI API
v0.0.5
2025-05-31 06:06 UTC
Requires
- php: ^8.0|^8.1|^8.2|^8.3
- ext-json: *
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- laravel/framework: 10.*
- orchestra/testbench: ^6.0|^7.0|^8.0|^9.0|^10.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.0|^10.0|^11.0
- squizlabs/php_codesniffer: ^3.13
This package is auto-updated.
Last update: 2026-06-29 09:20:01 UTC
README
A professional-grade PHP SDK for the Google Trends CLI API. This SDK provides a simple, intuitive interface to interact with the Google Trends API, allowing developers to access trending searches, related topics and queries, comparison data, and more.
Features
- Seamless integration with Laravel applications
- Compatible with standalone PHP projects
- Support for all Google Trends API endpoints
- Comprehensive error handling
- Extensive documentation and examples
Requirements
- PHP 8.0 or higher
- JSON extension
- cURL extension
- Composer
Installation
composer require gtrends/gtrends-php-sdk
Quick Start
Standalone PHP
<?php require 'vendor/autoload.php'; $client = new Gtrends\Sdk\Client([ 'base_uri' => 'https://trends-api-url.com', 'timeout' => 30 ]); // Get trending searches $trending = $client->getTrending('US');
Laravel Integration
Add the service provider to your config/app.php file:
'providers' => [ // Other service providers... Gtrends\Sdk\Laravel\GtrendsServiceProvider::class, ],
Publish the configuration:
php artisan vendor:publish --provider="Gtrends\Sdk\Laravel\GtrendsServiceProvider"
Use the facade in your code:
use Gtrends\Sdk\Laravel\Facades\Gtrends; // Get trending searches $trending = Gtrends::getTrending('US');
Documentation
For full documentation, examples, and API reference, please see the docs directory.
License
This package is open-sourced software licensed under the MIT license.