All Projects → x-fran → g-trends

x-fran / g-trends

Licence: MIT license
Google Trends API for PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to g-trends

stock-market-prediction-via-google-trends
Attempt to predict future stock prices based on Google Trends data.
Stars: ✭ 45 (-48.86%)
Mutual labels:  trends, google-trends
pypi-tools
Command-line Python scripts to do things with PyPI
Stars: ✭ 18 (-79.55%)
Mutual labels:  trends
gold-price-analysis
Creating a model to analyze and predict the trend of the prices of gold.
Stars: ✭ 31 (-64.77%)
Mutual labels:  trends
laravel-gsuite
A Laravel package to setup Google OAuth and GSuite Admin SDK.
Stars: ✭ 17 (-80.68%)
Mutual labels:  google-api
stock-volatility-google-trends
Deep Learning Stock Volatility with Google Domestic Trends: https://arxiv.org/pdf/1512.04916.pdf
Stars: ✭ 74 (-15.91%)
Mutual labels:  google-trends
google-drive-direct-remote-upload
Directly upload files from the web to Google Drive without saving them completely on the server before.
Stars: ✭ 62 (-29.55%)
Mutual labels:  google-api
node-social-feed-api
Aggregates social media feeds and outputs them to use in an API
Stars: ✭ 20 (-77.27%)
Mutual labels:  google-api
BookSplore
A place for you to explore books with your friends!
Stars: ✭ 24 (-72.73%)
Mutual labels:  explore
Unity live caption
Use Google Speech-to-Text API to do real-time live stream caption on Unity! Best when combined with your virtual character!
Stars: ✭ 26 (-70.45%)
Mutual labels:  google-api
ga-fetcher
Fetch Google Analytics data with Google APIs in Node.js 🚠
Stars: ✭ 14 (-84.09%)
Mutual labels:  google-api
youtube-video-maker
📹 A tool for automatic video creation and uploading on YouTube
Stars: ✭ 134 (+52.27%)
Mutual labels:  google-api
goco
Connecting to Google API has never been easier!
Stars: ✭ 14 (-84.09%)
Mutual labels:  google-api
hacker-feeds-cli
📰 A command line tool for Hacker News、 Product Hunt、 GitHub Trending 、Reddit and V2EX feeds.
Stars: ✭ 129 (+46.59%)
Mutual labels:  trending
face-recognition
얼굴 인식에 대한 기술 동향 및 관련 모델 자료
Stars: ✭ 38 (-56.82%)
Mutual labels:  trends
ics2gcal
Import .ics files into Google Calendar with only two clicks.
Stars: ✭ 21 (-76.14%)
Mutual labels:  google-api
hackertab.dev
Hackertab turns your New Tab page into a geeky one that keeps you as a developer updated with the best tools, news, jobs and events.
Stars: ✭ 229 (+160.23%)
Mutual labels:  trending
google fit hass
A Home assistant custom component to get your fitness information using Google Fitness API.
Stars: ✭ 23 (-73.86%)
Mutual labels:  google-api
e-commerce-suit-in-flutter
A playground for your e-commerce app.
Stars: ✭ 105 (+19.32%)
Mutual labels:  trending
go-trending
Trending algorithm based on the article "Trending at Instagram"
Stars: ✭ 40 (-54.55%)
Mutual labels:  trending
SMSRetrieverAPIDemo
Demo of the Google API of SMS retriever
Stars: ✭ 49 (-44.32%)
Mutual labels:  google-api

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

Please see the composer.json file.

Installation

Via Composer (require)

If you have composer installed globally

$ composer require x-fran/g-trends

If you use composer.phar local

# Get your own copy of composer.phar
$ curl -s https://getcomposer.org/installer | php -- --filename=composer
$ composer require "x-fran/g-trends": "^3.0"

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):

$ curl -s https://getcomposer.org/installer | php -- --filename=composer
$ composer --no-dev create-project x-fran/g-trends path/to/install

Via Git (clone)

First, clone the repository:

$ git clone https://github.com/x-fran/g-trends.git # optionally, specify the directory in which to clone
$ cd path/to/install
$ curl -s https://getcomposer.org/installer | php -- --filename=composer

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

$ composer --no-dev install

Demo

To see a demo output from all methods (okay, functions) please open in your favorite browser the index.php

Usage

New instance of the class GTrends

use Google\GTrends;

# This options are by default if none provided
$options = [
    'hl' => 'en-US',
    'tz' => 0,
    'geo' => 'US',
    'time' => 'all',
    'category' => 0,
];
$gt = new GTrends($options);

Interest Over Time

$gt->getInterestOverTime('Dublin');

Related Queries

$gt->getRelatedSearchQueries(['Donald Trump', 'Barack Obama']);

Realtime Search Trends

# Categories for Realtime Search Trends are a single char str:
$gt->getRealTimeSearchTrends('all');
#
# Categories
# all : default
# b : business
# e : entertainment
# m : health/medical
# t : sci/tech
# s : sports
# h : top stories

Daily Search Trends

$gt->getDailySearchTrends();

Trending Searches

# p54 is Google's tricky and wired code for Ireland
print_r($gt->trendingSearches('p54', date('Ymd')));
#
# National Region Codes:
# IRELAND=p54
# UNITED_STATES=p1
# ARGENTINA=p30
# AUSTRALIA=p8
# AUSTRIA=p44
# BELGIUM=p41
# BRAZIL=p18
# CANADA=p13
# CHILE=p38
# COLOMBIA=p32
# CZECHIA=p43
# DENMARK=p49
# EGYPT=p29
# FINLAND=p50
# FRANCE=p16
# GERMANY=p15
# GREECE=p48
# HONG_KONG=p10
# HUNGARY=p45
# INDIA=p3
# INDONESIA=p19
# ISRAEL=p6
# ITALY=p27
# JAPAN=p4
# KENYA=p37
# MALAYSIA=p34
# MEXICO=p21
# NETHERLANDS=p17
# NEW_ZEALAND=p53
# NIGERIA=p52
# NORWAY=p51
# PHILIPPINES=p25
# POLAND=p31
# PORTUGAL=p47
# ROMANIA=p39
# RUSSIA=p14
# SAUDI_ARABIA=p36
# SINGAPORE=p5
# SOUTH_AFRICA=p40
# SOUTH_KOREA=p23
# SPAIN=p26
# SWEDEN=p42
# SWITZERLAND=p46
# TAIWAN=p12
# THAILAND=p33
# TURKEY=p24
# UKRAINE=p35
# UNITED_KINGDOM=p9
# VIETNAM=p28

Suggestions Autocomplete

$gt->suggestionsAutocomplete('Milwaukee');

Common API parameters

$keyWords (Array)

Array of keywords (up to 5) to get data for

$options['category'] (Integer)

Search by category Please view this wiki page containing all available categories

$options['tz'] (Integer)

Timezone Offset For example US CST is 360

$options['time'] (String)

Timezone Offset

'now 1-H' would get data from last hour
'now 1-d' would get data from last day
'today 2-d' would get data from today to 2 days ago
'today 3-m' would get data from today to 3 months ago
'today 4-y' would get data from today to 4 years ago

Caveats

- This is not an official or supported API
- Rate Limit is not publicly known, let me know if you have a consistent estimate.

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].