Google Finance API
The Google Finance API, accessible via the /api/v1/search?engine=google_finance
endpoint, provides real-time access to financial market data. This API offers a wide range of information, including stock quotes, market indices, currency exchange rates, and more.
Key features of the Google Finance API include:
- Real-time price change and historical data.
- Quarterly and annual company financials.
- Exchange rates for major world currencies, including cryptocurrency.
- Top news and articles.
- Key events impacting the price movement.
API Parameters
Search Query
-
- Name
-
q
- Required
- Required
- Description
-
The parameter defines the query you want to search. The query can be one of the following types:
- Stock. For example -
NVDA:NASDAQ
. - Index. For example -
.DJI:INDEXDJ
. - Mutual Fund. For example -
VTSAX:MUTF
. - Currency. For example -
BTC-USD
. - Futures. For example -
GCW00:COMEX
.
-
instead of a colon:
to separate the symbol from the exchange. - Stock. For example -
Localization
-
- Name
-
hl
- Required
- Optional
- Description
-
The default parameter
en
defines the interface language of the search. Check the full list of supported Googlehl
languages.
Filters
-
- Name
-
window
- Required
- Optional
- Description
-
Specifies the time period for which graph results will be returned. Available options include:
1D
(Default) - past 1 day.5D
- past 5 days.1M
- past 1 month.6M
- past 6 months.YTD
- current year to date.1Y
- past 1 year.5Y
- past 5 years.MAX
- maximum available graph data.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_finance
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=google_finance&q=TSLA%3ANASDAQ
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "TSLA:NASDAQ"
}
response = requests.get(url, params = params)
print(response.text)
{
"search_metadata": {
"id": "search_AxENYzjKgR4Pcdx3D0M4GJbe",
"status": "Success",
"created_at": "2024-02-20T18:43:10Z",
"request_time_taken": 1.44,
"parsing_time_taken": 0.06,
"total_time_taken": 1.5,
"request_url": "https://www.google.com/finance/quote/TSLA:NASDAQ?hl=en",
"html_url": "https://www.searchapi.io/api/v1/searches/search_AxENYzjKgR4Pcdx3D0M4GJbe.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_AxENYzjKgR4Pcdx3D0M4GJbe"
},
"search_parameters": {
"engine": "google_finance",
"q": "TSLA:NASDAQ",
"hl": "en"
},
"markets": {
"us": [
{
"stock": ".DJI",
"exchange": "INDEXDJX",
"company": "Dow Jones Industrial Average",
"link": "https://www.google.com/finance/quote/.DJI:INDEXDJX",
"name": "Dow Jones",
"price": 38554.98,
"price_change": {
"percentage": 0.18900236,
"amount": -73.00781,
"movement": "Down"
},
"date": "Feb 20, 01:42:57 PM UTC-05:00"
},
...
]
...
},
"summary": {
"title": "Tesla Inc",
"stock": "TSLA",
"exchange": "NASDAQ",
"price": 190.838,
"currency": "USD",
"date": "Feb 20, 01:43:01 PM UTC-05:00",
"price_change": {
"percentage": 4.557139,
"amount": -9.1119995,
"movement": "Down"
}
},
"graph": [
{
"price": 208.8,
"currency": "USD",
"date": "Jan 22 2024, 04:00 PM UTC-05:00",
"volume": 117952527
},
...
],
"knowledge_graph": {
"tags": [
{
"title": "Trending",
"description": "This security is a popular search topic on Google"
},
...
],
"stats": [
{
"label": "Previous close",
"description": "The last closing price",
"value": "$199.95"
},
...
],
"about": {
"company": "Tesla",
"description": "Tesla, Inc. is an American multinational automotive and clean energy company headquartered in Austin, Texas, which designs, manufactures and sells electric vehicles, stationary battery energy storage devices from home to grid-scale, solar panels and solar shingles, and related products and services.\nTesla was incorporated in July 2003 by Martin Eberhard and Marc Tarpenning as Tesla Motors. The company's name is a tribute to inventor and electrical engineer Nikola Tesla. In February 2004 Elon Musk joined as the company's largest shareholder and in 2008 he was named CEO. In 2008, the company began production of its first car model, the Roadster sports car, followed by the Model S sedan in 2012, the Model X SUV in 2015, the Model 3 sedan in 2017, the Model Y crossover in 2020, the Tesla Semi truck in 2022 and the Cybertruck pickup truck in 2023. The Model 3 is the all-time bestselling plug-in electric car worldwide, and in June 2021 became the first electric car to sell 1 million units globally. In 2023, the Model Y was the best-selling vehicle, of any kind, globally.\nTesla is one of the world's most valuable companies.",
"founded": "Jul 01 2003",
"ceo": "Elon Musk",
"employees": 140473,
"website": "https://www.tesla.com/",
"wikipedia": "https://en.wikipedia.org/wiki/Tesla,_Inc."
}
},
"news": [
{
"title": "News about Tesla",
"articles": [
{
"snippet": "Cybertruck engineer addresses claims the Tesla EVs rust in rain",
"link": "https://www.businessinsider.com/cybertruck-engineer-addresses-claims-the-tesla-evs-rust-in-rain-2024-2",
"source": "Business Insider",
"date": "1 day ago",
"thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTnVVygpxGQEQnqVjAuEik3q81Ygsg_XXNTpqyz9xfE7UbxMfBaHu0YhDK1Qm0"
},
...
]
},
...
],
"articles": [
{
"snippet": "Tuesday's top stocks to buy like NVDA, TSLA and JBLU",
"link": "https://www.cnbc.com/2024/02/20/tuesdays-top-stocks-to-buy-like-nvda-tsla-and-jblu.html",
"source": "CNBC",
"date": "5 hours ago",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTdpRCFd_mg994u32gqrHbA2mDCoGMTAkg0eTc4C0t6T6U4KtUC9WrOUdVHnU0"
},
...
],
"financials": {
"quarterly": [
{
"year": 2023,
"quarter": 3,
"currency": "USD",
"revenue": {
"value": 23350000000,
"last_year_value": 21454000000,
"price_change": {
"percentage": 8.8375,
"amount": 1896000000,
"movement": "Up"
}
},
"net_income": {
"value": 1853000000,
"last_year_value": 3292000000,
"price_change": {
"percentage": 43.712,
"amount": -1439000000,
"movement": "Down"
}
},
"earnings_per_share": {
"value": 0.53,
"last_year_value": 0.95,
"price_change": {
"percentage": 44.2105,
"amount": -0.41999999999999993,
"movement": "Down"
}
},
...
},
...
],
"annual": [
{
"year": 2022,
"currency": "USD",
"revenue": {
"value": 81462000000,
"last_year_value": 53823000000,
"price_change": {
"percentage": 51.3517,
"amount": 27639000000,
"movement": "Up"
}
},
"net_income": {
"value": 12556000000,
"last_year_value": 5519000000,
"price_change": {
"percentage": 127.505,
"amount": 7037000000,
"movement": "Up"
}
},
...
},
...
]
},
"compare_with": [
{
"stock": "AAPL",
"exchange": "NASDAQ",
"company": "Apple Inc",
"link": "https://www.google.com/finance/quote/AAPL:NASDAQ",
"name": "Apple Inc",
"price": 180.815,
"price_change": {
"percentage": 0.82002914,
"value": -1.4949951,
"movement": "Down"
},
"date": "Feb 20, 01:42:40 PM UTC-05:00"
},
...
],
"discover_more": [
{
"title": "You may be interested in",
"items": [
{
"stock": ".DJI:INDEXDJX",
"link": "https://www.google.com/finance/quote/.DJI:INDEXDJX",
"name": "Dow Jones Industrial Average",
"price": 38554.98,
"price_change": {
"percentage": 0.19,
"movement": "Down"
}
},
...
]
},
...
]
}
Graph & Key Events
Development tips:
- Key events are returned only when used together with the
window
parameter.
https://www.searchapi.io/api/v1/search?engine=google_finance&q=NI225%3AINDEXNIKKEI&window=MAX
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "NI225:INDEXNIKKEI",
"window": "MAX"
}
response = requests.get(url, params = params)
print(response.text)
{
"key_events": [
{
"title": "Japan's Nikkei 225 Rises 7.7% for Biggest Gain Since October 2008",
"link": "https://www.bloomberg.com/news/articles/2015-09-09/japanese-stocks-rally-amid-confidence-in-china-market-stability",
"source": "Bloomberg.com",
"source_date": "September 09, 2015",
"date": "September 09, 2015",
"price_change": {
"percentage": 7.708864999999999,
"movement": "Up"
}
},
{
"title": "Japan's Nikkei stock index falls more than 1,000 points",
"link": "https://www.cnbc.com/2018/02/05/japans-nikkei-stock-index-suffers-heavy-losses-after-us-market-sell-off.html",
"source": "CNBC",
"source_date": "February 06, 2018",
"date": "February 06, 2018",
"price_change": {
"percentage": -4.725492399999999,
"movement": "Down"
}
},
...
],
"graph": [
{
"price": 21425.51,
"date": "Feb 22 2019, 03:00 PM UTC+09:00"
},
{
"price": 21602.69,
"date": "Mar 01 2019, 03:00 PM UTC+09:00"
}
...
]
}
Knowledge Graph
https://www.searchapi.io/api/v1/search?engine=google_finance&q=MSFT%3ANASDAQ
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "MSFT:NASDAQ"
}
response = requests.get(url, params = params)
print(response.text)
{
"knowledge_graph": {
"tags": [
{
"title": "Stock",
"description": "Ownership of a fraction of a corporation and the right to claim a share of the corporation's assets and profits equal to the amount of stock owned"
},
{
"title": "Climate leader",
"description": "Company has received a CDP Climate Score of A, reflecting its commitment to environmental sustainability efforts, social impact, and corporate transparency"
},
...
],
"stats": [
{
"label": "Previous close",
"description": "The last closing price",
"value": "$404.06"
},
{
"label": "Day range",
"description": "The range between the high and low prices over the past day",
"value": "$398.01 - $404.49"
},
...
],
"about": {
"company": "Microsoft Corporation",
"description": "Microsoft Corporation is an American multinational technology corporation headquartered in Redmond, Washington. Microsoft's best-known software products are the Windows line of operating systems, the Microsoft 365 suite of productivity applications, and the Edge web browser. Its flagship hardware products are the Xbox video game consoles and the Microsoft Surface lineup of touchscreen personal computers. Microsoft ranked No. 14 in the 2022 Fortune 500 rankings of the largest United States corporations by total revenue; it was the world's largest software maker by revenue as of 2022. It is considered one of the Big Five American information technology companies, alongside Alphabet, Amazon, Apple, and Meta.\nMicrosoft was founded by Bill Gates and Paul Allen on April 4, 1975, to develop and sell BASIC interpreters for the Altair 8800. It rose to dominate the personal computer operating system market with MS-DOS in the mid-1980s, followed by Windows. The company's 1986 initial public offering and subsequent rise in its share price created three billionaires and an estimated 12,000 millionaires among Microsoft employees.",
"address": "Redmond, Washington, United States, US, One Microsoft Way",
"founded": "Apr 04 1975",
"ceo": "Satya Nadella",
"employees": 221000,
"website": "http://www.microsoft.com/",
"wikipedia": "https://en.wikipedia.org/wiki/Microsoft"
}
}
}
News & Articles
https://www.searchapi.io/api/v1/search?engine=google_finance&q=BTC-USD
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "BTC-USD"
}
response = requests.get(url, params = params)
print(response.text)
{
"news": [
{
"title": "News about Bitcoin",
"articles": [
{
"snippet": "Better Bitcoin Mining Stock: Riot or Marathon?",
"link": "https://finance.yahoo.com/news/better-bitcoin-mining-stock-riot-134900802.html",
"source": "Yahoo Finance",
"date": "1 day ago",
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSRXDDmy4KH2qOLYJrY815jswQ6iLTe5v246MjXV07KZ5TRdrpaZFJsqo_bYJQ"
},
{
"snippet": "The 2024 Bitcoin Halving: A BTC Value Boom or a Survival Crisis for Miners?",
"link": "https://bitcoinmagazine.com/markets/the-2024-bitcoin-halving-a-btc-value-boom-or-a-survival-crisis-for-miners",
"source": "Bitcoin Magazine",
"date": "1 day ago",
"thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQ5ERbmG-tYQxO8kgUdQgsJTIn2BOuNYUJxi-rW7Kyzh0WaP1pp0oih6Bpn1hQ"
},
{
"snippet": "Bitcoin Price (BTC) Slumps After Hitting Resistance at$53K",
"link": "https://www.coindesk.com/markets/2024/02/20/bitcoin-suffers-swift-reversal-at-53k-suggesting-more-consolidation-ahead/",
"source": "CoinDesk",
"date": "45 minutes ago",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ-RyyIOQWP874B87sejN1NdCioWB9l9pZdgx29-OlkipnOkcsaTmELTLLATMc"
}
]
},
...
],
"articles": [
{
"snippet": "MicroStrategy's bitcoin windfall bringing it to S&P 500 territory",
"link": "https://www.thestreet.com/crypto/markets/microstrategy-bitcoin-windfall-bringing-it-to-sp500-territory",
"source": "TheStreet",
"date": "1 day ago",
"thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTbbEwUtzZXJsifHZ-DJI66L25gr0UW2cMm9kdrcodilpUwj86RqOlkji27E_s"
}
...
]
}
Market & Summary
https://www.searchapi.io/api/v1/search?engine=google_finance&q=EUR-USD
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "EUR-USD"
}
response = requests.get(url, params = params)
print(response.text)
{
"markets": {
"us": [
{
"stock": ".DJI",
"exchange": "INDEXDJX",
"company": "Dow Jones Industrial Average",
"link": "https://www.google.com/finance/quote/.DJI:INDEXDJX",
"name": "Dow Jones",
"price": 38542.75,
"price_change": {
"percentage": 0.22066456,
"amount": -85.23828,
"movement": "Down"
},
"date": "Feb 20, 02:03:27 PM UTC-05:00"
},
...
],
"europe": [
{
"stock": "DAX",
"exchange": "INDEXDB",
"company": "DAX PERFORMANCE-INDEX",
"link": "https://www.google.com/finance/quote/DAX:INDEXDB",
"name": "DAX",
"price": 17068.43,
"price_change": {
"percentage": 0.13942029,
"amount": -23.830078,
"movement": "Down"
},
"date": "Feb 20, 06:30:24 PM UTC+01:00"
},
...
],
"asia": [
{
"stock": "NI225",
"exchange": "INDEXNIKKEI",
"company": "Nikkei 225",
"link": "https://www.google.com/finance/quote/NI225:INDEXNIKKEI",
"price": 38363.61,
"price_change": {
"percentage": 0.277537,
"amount": -106.76953,
"movement": "Down"
},
"date": "Feb 20, 03:15:02 PM UTC+09:00"
},
...
]
...
},
"summary": {
"title": "EUR / USD",
"price": 1.08084,
"date": "Feb 20, 07:04:00 PM UTC+00:00",
"price_change": {
"percentage": 0.3099767981438627,
"amount": 0.003340000000000121,
"movement": "Up"
}
}
}
Compare To
https://www.searchapi.io/api/v1/search?engine=google_finance&q=EUR-USD
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_finance",
"q": "EUR-USD"
}
response = requests.get(url, params = params)
print(response.text)
{
"compare_with": [
{
"company": "JPY / USD",
"link": "https://www.google.com/finance/quote/JPY-USD",
"name": "JPY / USD",
"price": 0.0066671555,
"price_change": {
"percentage": 0.1909323835929302,
"amount": 0.00001270549999999974,
"movement": "Up"
},
"date": "Feb 20, 07:04:00 PM UTC+00:00"
},
{
"company": "GBP / USD",
"link": "https://www.google.com/finance/quote/GBP-USD",
"name": "GBP / USD",
"price": 1.262205,
"price_change": {
"percentage": 0.2796569435561692,
"amount": 0.003519999999999968,
"movement": "Up"
},
"date": "Feb 20, 07:04:00 PM UTC+00:00"
},
...
]
}