Download the PHP package x-fran/g-trends without Composer

On this page you can find all versions of the php package x-fran/g-trends. 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 g-trends

g-trends

Google Trends API for PHP

Introduction

This is an unofficial Google Trends API for PHP.

Please notice that the good functionality of this API depends on Google's willing to keep the backward compatibility and/or the parameters, naming and/or required values.
If this happens, feel free to contribute or open an issue.

Requirements

PHP 8.3 or higher. Please see the composer.json file.

Status (September 2026)

Google retired the dailytrends and realtimetrends endpoints in 2025. Since 5.0 this library reads Google's "Trending Now" page instead, which returns richer data (search volume, growth, related queries, topics). The explore-based methods (interest over time, related queries, related topics, compared geo) and the pickers (suggestions, categories, geo) still work.

5.0 is a rewrite with a new API — see Usage below. It requires PHP 8.3+.

Installation

Via Composer (require)

If you have composer installed globally

If you use composer.phar local

Via Composer (create-project)

You can use the create-project command from Composer to create the project in one go (you need to install composer):

Via Git (clone)

First, clone the repository:

At this point, you need to use Composer to install dependencies. Assuming you already have Composer:

Demo

Open index.php in a browser (or php -S localhost:8000) to see the output of every method.

Usage

Create a client

Every method throws XFran\GTrends\GTrendsException when Google answers with a non-200 status (HTTP 429 = rate limited) or an unexpected payload, and InvalidArgumentException for bad arguments.

Trending Now

Google retired the dailytrends and realtimetrends endpoints in 2025. getTrendingNow() reads the list behind trends.google.com/trending instead.

Explore (interest over time, related queries, related topics, compared geo)

Up to 5 keywords per call.

The widget payloads are returned exactly as Google sends them.

Pickers

Development

Caveats

- This is not an official or supported API; every endpoint is undocumented and can change without notice
- Rate limits are not publicly known. Google throttles by IP: sustained explore use returns HTTP 429 and the block can persist for a while. Use the `proxy` option if you hit it

Credits


All versions of g-trends with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-curl Version *
ext-json Version *
ext-simplexml Version *
laminas/laminas-http Version ^2.23
laminas/laminas-stdlib Version ^3.21
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 x-fran/g-trends contains the following files

Loading the files please wait ...