Download the PHP package purewater2011/google-trends without Composer
On this page you can find all versions of the php package purewater2011/google-trends. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package google-trends
Google Trends PHP API
A easier way to search on Google Trends and get a standard response in JSON or PHP DTO.
Dependencies
- PHP 7.2+
- PHP ext-json
Advantages on using this API
- Get standard response that can be easily imported to your BI system.
- No need to have a google account.
- No need for web scraping data from Google Trends UI.
- We deal with Google request token handling for you.
- Allows you to create custom reports that better fit to your business.
Current support
- PSR7 Support
- Related topics Search.
- Related queries Search.
- Interest over time Search.
- Interest by region Search.
- Search by categories.
- Search by location.
- Language support.
- Includes top or rising metrics.
- Search type:
- Web
- Image
- News
- Youtube
- Google Shopping
Usage
Using Open API and PSR7
The library provides PSR7 http message support. Check \GSoares\GoogleTrends\Search\Psr7\Search.
Example:
You can check all Open API specs here.
And you can view the open api using swagger editor with (File -> Import URL -> Select openapi.yaml URL).
If you prefer your own implementation, please use the steps bellow:
1) Create a SearchFilter
with your restrictions
2) Execute the search you wish to
Related Queries
JSON response example:
Related Topics
JSON response example:
Interest Over Time
JSON response example:
Interest By Region
JSON response example:
Installation
The Project is available on Packagist and you can install it using Composer:
Testing
Start PHP local server:
Access the api endpoints:
- http://localhost:8000/search-interest-by-region?withTopMetrics=1&withRisingMetrics=1&searchTerm=carros&location=BR
- http://localhost:8000/search-interest-over-time?withTopMetrics=1&withRisingMetrics=1&searchTerm=carros&location=BR
- http://localhost:8000/search-related-topics?withTopMetrics=1&withRisingMetrics=1&searchTerm=carros&location=BR
- http://localhost:8000/search-related-queries?withTopMetrics=1&withRisingMetrics=1&searchTerm=carros&location=BR
Example
After install it you can access an working example here.
Google Categories
You can find the categories available on Google here.
Contributing
I am really happy you can help with this project. If you are interest on how to contribute, please check this page.
All versions of google-trends with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^6.5
psr/http-message Version ^1.0