Google Finance API

Our Google Finance API allows you to scrape results from the Google Finance page. The API is accessed through the following endpoint: /search?engine=google_finance.

A user may query the following: https://serpapi.com/search?engine=google_finance utilizing a GET request. Head to the playground for a live and interactive demo.

API Parameters

Search Query

q

Required

Parameter defines the query you want to search. It can be a stock, index, mutual fund, currency or futures.

Localization

hl

Optional

Parameter defines the language to use for the Google Finance search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French). Head to the Google languages page for a full list of supported Google languages.

Advanced Google Finance Parameters

window

Optional

Parameter is used for setting time range for the graph. It can be set to:
1D - 1 Day(default)
5D - 5 Days
1M - 1 Month
6M - 6 Months
YTD - Year to Date
1Y - 1 Year
5Y - 5 Years
MAX - Maximum

Serpapi Parameters

engine

Required

Set parameter to google_finance to use the Google Finance API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the Google Finance results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together. async should not be used on accounts with Ludicrous Speed enabled.

api_key

Required

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

API Results

JSON Results

JSON output includes structured data for "Markets", "Graph", "Summary", "Knowledge graph", "News Results", "Financials", "Futures chain" and "Discover More".

A search status is accessible through search_metadata.status. It flows this way: Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML Results

HTML output is useful to debug JSON results or support features not supported yet by SerpApi. HTML output gives you the raw HTML results from Google.

API Examples

Example with q: GOOG:NASDAQ

Example with q: GOOG:NASDAQ

JSON Example

{
  "search_metadata": {
    "id": "63a6ecdbde983400ad3d6ad0",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/17a37f452a7755fd/63a6ecdbde983400ad3d6ad0.json",
    "created_at": "2022-12-24 12:13:15 UTC",
    "processed_at": "2022-12-24 12:13:15 UTC",
    "google_finance_url": "https://www.google.com/finance/quote/GOOGL:NASDAQ?hl=en",
    "raw_html_file": "https://serpapi.com/searches/17a37f452a7755fd/63a6ecdbde983400ad3d6ad0.html",
    "total_time_taken": 1.65
  },
  "search_parameters": {
    "engine": "google_finance",
    "q": "GOOGL:NASDAQ",
    "hl": "en"
  },
  "markets": {
    "us": [
      {
        "stock": ".DJI:INDEXDJX",
        "link": "https://www.google.com/finance/quote/.DJI:INDEXDJX",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=.DJI%3AINDEXDJX",
        "name": "Dow Jones",
        "price": 33203.93,
        "price_movement": {
          "percentage": 0.53422594,
          "value": 176.4414,
          "movement": "Up"
        }
      },
      ...
    ],
    "europe": [
      {
        "stock": "DAX:INDEXDB",
        "link": "https://www.google.com/finance/quote/DAX:INDEXDB",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=DAX%3AINDEXDB",
        "name": "DAX",
        "price": 13940.93,
        "price_movement": {
          "percentage": 0.19303751,
          "value": 26.859375,
          "movement": "Up"
        }
      },
      ...
    ],
    "asia": [
      {
        "stock": "NI225:INDEXNIKKEI",
        "link": "https://www.google.com/finance/quote/NI225:INDEXNIKKEI",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=NI225%3AINDEXNIKKEI",
        "name": "Nikkei 225",
        "price": 26235.25,
        "price_movement": {
          "percentage": 1.0284461,
          "value": 272.61914,
          "movement": "Down"
        }
      },
      ...
    ],
    "currencies": [
      {
        "stock": "EUR-USD",
        "link": "https://www.google.com/finance/quote/EUR-USD",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=EUR-USD",
        "name": "EUR / USD",
        "price": 1.0666499999999999,
        "price_movement": {
          "percentage": 0.018746777897546796,
          "value": 0.00019999999999997797,
          "movement": "Down"
        }
      },
      ...
    ],
    "crypto": [
      {
        "stock": "BTC-USD",
        "link": "https://www.google.com/finance/quote/BTC-USD",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=BTC-USD",
        "name": "Bitcoin",
        "price": 16827.100000000002,
        "price_movement": {
          "percentage": 0.2974274610781385,
          "value": 49.900000000001455,
          "movement": "Up"
        }
      },
      ...
    ],
    "futures": [
      {
        "stock": "YMW00:CBOT",
        "link": "https://www.google.com/finance/quote/YMW00:CBOT",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=YMW00%3ACBOT",
        "name": "Dow Futures",
        "price": 33352.0,
        "currency": "USD",
        "price_movement": {
          "percentage": 0.43363044,
          "value": 144.0,
          "movement": "Up"
        }
      },
      ...
    ]
  },
  "graph": [
    {
      "price": 87.09,
      "currency": "USD",
      "date": "Dec 23 2022, 09:30 AM UTC-05:00",
      "volume": 4819
    },
    {
      "price": 87.1,
      "currency": "USD",
      "date": "Dec 23 2022, 09:31 AM UTC-05:00",
      "volume": 3824
    },
    {
      "price": 88.19,
      "currency": "USD",
      "date": "Dec 23 2022, 09:32 AM UTC-05:00",
      "volume": 103213
    },
    ...
  ],
  "summary": {
    "title": "Alphabet Inc Class A",
    "stock": "GOOGL",
    "exchange": "NASDAQ",
    "price": "$89.23",
    "extracted_price": 89.23,
    "currency": "$",
    "price_movement": {
      "percentage": 1.6750242,
      "value": 1.4700012,
      "movement": "Up"
    },
    "market": {
      "trading": "After Hours",
      "price": "$89.05",
      "extracted_price": 89.05,
      "currency": "$",
      "price_movement": {
        "percentage": 0.2,
        "value": 0.18,
        "movement": "Down"
      }
    },
    "extensions": [
      "Closed: Dec 23, 7:59:31 PM GMT-5",
      "USD",
      "NASDAQ"
    ]
  },
  "knowledge_graph": {
    "key_stats": {
      "tags": [
        {
          "text": "Most active",
          "link": "https://www.google.com/finance/markets/most-active",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance_markets&hl=en&trend=most-active",
          "description": "One of the most heavily traded stocks during the last trading session"
        },
        {
          "text": "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"
        },
        {
          "text": "US listed security",
          "description": "Listed on NASDAQ"
        },
        ...
      ],
      "stats": [
        {
          "label": "Previous close",
          "description": "The last closing price",
          "value": "$87.76"
        },
        {
          "label": "Day range",
          "description": "The range between the high and low prices over the past day",
          "value": "$87.07 - $89.55"
        },
        {
          "label": "Year range",
          "description": "The range between the high and low prices over the past 52 weeks",
          "value": "$83.34 - $151.55"
        },
        ...
      ],
      "climate_change": {
        "score": "A-",
        "link": "https://www.cdp.net/en/responses/7616"
      }
    },
    "about": [
      {
        "title": "About",
        "description": {
          "snippet": "Alphabet Inc. is an American multinational technology conglomerate holding company headquartered in Mountain View, California. It was created through a restructuring of Google on October 2, 2015, and became the parent company of Google and several former Google subsidiaries. Alphabet is the world's third-largest technology company by revenue and one of the world's most valuable companies. It is one of the Big Five American information technology companies, alongside Amazon, Apple, Meta and Microsoft.\nThe establishment of Alphabet Inc. was prompted by a desire to make the core Google business \"cleaner and more accountable\" while allowing greater autonomy to group companies that operate in businesses other than Internet services. Founders Larry Page and Sergey Brin announced their resignation from their executive posts in December 2019, with the CEO role to be filled by Sundar Pichai, also the CEO of Google. Page and Brin remain employees, board members, and controlling shareholders of Alphabet Inc. ",
          "link": "https://en.wikipedia.org/wiki/Alphabet_Inc.",
          "link_text": "Wikipedia"
        },
        "info": [
          {
            "label": "CEO",
            "value": "Sundar Pichai",
            "link": "https://www.google.com/search?q=Sundar%20Pichai&hl=en-US"
          },
          {
            "label": "Founded",
            "value": "Oct 2, 2015"
          },
          {
            "label": "Headquarters",
            "value": "Mountain View, CaliforniaUnited States",
            "link": "https://www.google.com/maps/place/1600%20Amphitheatre%20Pkwy%2C%20Mountain%20View%2C%20California%2C%20United%20States?hl=en-US"
          },
          ...
        ]
      }
    ]
  },
  "news_results": [
    {
      "title": "Top news",
      "items": [
        {
          "title": "Why Isn't Warren Buffett Buying Alphabet (Google) Stock Hand Over Fist?",
          "link": "https://www.fool.com/investing/2022/12/22/warren-buffett-isnt-buying-alphabet-google-stock/",
          "source": "The Motley Fool",
          "date": "2 days ago",
          "thumbnail": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQ2w2781KGgwAz8HpB-tKa4j7SkT7mOfrGSsmCDZcJr-cEadbMoJ5sMUP8Le2I"
        },
        ...
      ]
    },
    {
      "title": "Interviews",
      "items": [
        {
          "title": "We want to be a responsible local firm, assist in Digital India vision: Google CEO Sundar Pichai",
          "link": "https://m.economictimes.com/tech/technology/we-want-to-be-a-responsible-local-firm-assist-in-digital-india-vision-sundar-pichai/articleshow/96379536.cms",
          "source": "The Economic Times",
          "date": "3 days ago"
        },
        ...
      ]
    },
    {
      "title": "Why GOOG Stock Is a Value Trap for 2023",
      "link": "https://investorplace.com/market360/2022/12/goog-stock-it-could-be-sideways-from-here-in-2023/",
      "source": "InvestorPlace",
      "date": "3 days ago",
      "thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRk8uSFVASgsUQ_5SyR-rk46KRWKtjXLH1fIovQx3SdcKBrLNlaQwYyv2DOeJc"
    },
    ...
  ],
  "financials": [
    {
      "title": "Income Statement",
      "results": [
        {
          "date": "Sep 2022",
          "period_type": "Quarterly",
          "table": [
            {
              "title": "Revenue",
              "description": "The total amount of income generated by the sale of goods or services related to the company's primary operations",
              "value": "69092000000",
              "change": "6.10%"
            },
            ...
          ]
        },
        ...
        {
          "date": "2021",
          "period_type": "Annual",
          "table": [
            {
              "title": "Revenue",
              "description": "The total amount of income generated by the sale of goods or services related to the company's primary operations",
              "value": "257637000000",
              "change": "41.15%"
            },
            ...
          ]
        },
        ...
      ]
    },
    {
      "title": "Balance Sheet",
      "results": [
        {
          "date": "Sep 2022",
          "period_type": "Quarterly",
          "table": [
            {
              "title": "Cash and short-term investments",
              "description": "Investments that are relatively liquid and have maturities between 3 months and one year",
              "value": "116259000000",
              "change": "-18.13%"
            },
            ...
          ]
        },
        ...
        {
          "date": "2021",
          "period_type": "Annual",
          "table": [
            {
              "title": "Cash and short-term investments",
              "description": "Investments that are relatively liquid and have maturities between 3 months and one year",
              "value": "139649000000",
              "change": "2.16%"
            },
            ...
          ]
        },
        ...
      ]
    },
    {
      "title": "Cash Flow",
      "results": [
        {
          "date": "Sep 2022",
          "period_type": "Quarterly",
          "table": [
            {
              "title": "Net income",
              "description": "Company’s earnings for a period net of operating costs, taxes, and interest",
              "value": "13910000000",
              "change": "-26.54%"
            },
            ...
          ]
        },
        ...
        {
          "date": "2021",
          "period_type": "Annual",
          "table": [
            {
              "title": "Net income",
              "description": "Company’s earnings for a period net of operating costs, taxes, and interest",
              "value": "76033000000",
              "change": "88.81%"
            },
            ...
          ]
        },
        ...
      ]
    }
  ],
  "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": "33,203.93",
          "extracted_price": 33203.93,
          "price_movement": {
            "percentage": 0.53,
            "movement": "Up"
          }
        },
        ...
      ]
    },
    {
      "title": "People also search for",
      "items": [
        {
          "stock": "AMZN:NASDAQ",
          "link": "https://www.google.com/finance/quote/AMZN:NASDAQ",
          "name": "Amazon.com, Inc.",
          "price": "$85.25",
          "extracted_price": 85.25,
          "currency": "$",
          "price_movement": {
            "percentage": 1.74,
            "movement": "Up"
          }
        },
        ...
      ]
    }
  ]
}

Example with q: WMT:NYSE, and  window: MAX

The window parameter allows selection from a variety of date ranges. Only summary, and graph results are served for searches with  window parameter.

Example with q: WMT:NYSE, and  window: MAX

JSON Example

{
  "search_metadata": {
    "id": "652f0440914a81521a094004",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/d2634031e3148d90/652f0440914a81521a094004.json",
    "created_at": "2023-10-17 22:01:36 UTC",
    "processed_at": "2023-10-17 22:01:36 UTC",
    "google_finance_url": "https://www.google.com/finance/quote/WMT:NYSE?hl=en&window=MAX",
    "raw_html_file": "https://serpapi.com/searches/d2634031e3148d90/652f0440914a81521a094004.html",
    "prettify_html_file": "https://serpapi.com/searches/d2634031e3148d90/652f0440914a81521a094004.prettify",
    "total_time_taken": 1.37
  },
  "search_parameters": {
    "engine": "google_finance",
    "q": "WMT:NYSE",
    "hl": "en",
    "window": "MAX"
  },
  "summary": {
    "title": "Walmart Inc",
    "stock": "WMT",
    "exchange": "NYSE",
    "price": "USD 161.42",
    "extracted_price": 161.42,
    "currency": "USD",
    "market": {
      "price": "USD 161.21",
      "extracted_price": 161.21,
      "currency": "USD",
      "price_movement": {
        "percentage": 0.1300901,
        "value": 0.20999146,
        "movement": "Down"
      }
    },
    "extensions": [
      "America/New_York",
      "USD",
      "NYSE"
    ]
  },
  "graph": [
    {
      "price": 1.28,
      "currency": "USD",
      "date": "Oct 21 1983, 04:00 PM UTC-04:00",
      "volume": 1004000
    },
    {
      "price": 1.27,
      "currency": "USD",
      "date": "Oct 28 1983, 04:00 PM UTC-04:00",
      "volume": 673800
    },
    {
      "price": 1.27,
      "currency": "USD",
      "date": "Nov 04 1983, 04:00 PM UTC-04:00",
      "volume": 960500
    },
    ...
  ]
}

key_events example with q: GOOGL:NASDAQ, and  window: 1Y

Usually when window parameter is set to 6M and above, key_events will be present in the result. Individual key_event is also added to the relevant graph item that occurs at the same day.

key_events example with q: GOOGL:NASDAQ, and  window: 1Y

JSON Example

{
  ...
  "key_events": [
    {
      "title": "Alphabet Stock Falls After Google Parent Reports Earnings",
      "link": "https://www.wsj.com/livecoverage/stock-market-news-today-02-02-2023/card/alphabet-earnings-what-to-expect-GFg3qwVtkUaBwme427Hq",
      "source": "The Wall Street Journal",
      "source_date": "Feb 02 2023, 06:31 PM UTC-05:00",
      "date": "Feb 03 2023, 04:00 PM UTC-05:00",
      "price_movement": {
        "percentage": 0.027473547,
        "movement": "Down"
      }
    },
    {
      "title": "Alphabet is increasing its stock buyback program by $70B",
      "link": "https://www.bizjournals.com/sanjose/news/2023/04/25/alphabet-ups-stock-buyback-program-by-70b.html",
      "source": "The Business Journals",
      "source_date": "Apr 25 2023, 04:28 PM UTC-05:00",
      "date": "Apr 26 2023, 03:00 PM UTC-05:00",
      "price_movement": {
        "percentage": 0.0013480983,
        "movement": "Down"
      }
    },
    {
      "title": "Alphabet Shares Jump After AI-Focused Developer Conference",
      "link": "https://www.redherring.com/internet/alphabet-shares-jump-after-ai-focused-developer-conference/",
      "source": "Red Herring",
      "source_date": "May 12 2023, 02:00 AM UTC-05:00",
      "date": "May 11 2023, 03:00 PM UTC-05:00",
      "price_movement": {
        "percentage": 0.043131992,
        "movement": "Up"
      }
    },
    ...
  ],
  "graph": [
    ...
    {
      "price": 104.78,
      "currency": "USD",
      "date": "Feb 03 2023, 04:00 PM UTC-05:00",
      "volume": 65309261,
      "key_event": {
        "title": "Alphabet Stock Falls After Google Parent Reports Earnings",
        "link": "https://www.wsj.com/livecoverage/stock-market-news-today-02-02-2023/card/alphabet-earnings-what-to-expect-GFg3qwVtkUaBwme427Hq",
        "source": "The Wall Street Journal",
        "source_date": "Feb 02 2023, 06:31 PM UTC-05:00",
        "date": "Feb 03 2023, 04:00 PM UTC-05:00",
        "price_movement": {
          "percentage": 0.027473547,
          "movement": "Down"
        }
      }
    },
    ...
    {
      "price": 103.71,
      "currency": "USD",
      "date": "Apr 26 2023, 04:00 PM UTC-05:00",
      "volume": 53347560,
      "key_event": {
        "title": "Alphabet is increasing its stock buyback program by $70B",
        "link": "https://www.bizjournals.com/sanjose/news/2023/04/25/alphabet-ups-stock-buyback-program-by-70b.html",
        "source": "The Business Journals",
        "source_date": "Apr 25 2023, 04:28 PM UTC-05:00",
        "date": "Apr 26 2023, 03:00 PM UTC-05:00",
        "price_movement": {
          "percentage": 0.0013480983,
          "movement": "Down"
        }
      }
    },
    ...
    {
      "price": 116.57,
      "currency": "USD",
      "date": "May 11 2023, 04:00 PM UTC-05:00",
      "volume": 78900029,
      "key_event": {
        "title": "Alphabet Shares Jump After AI-Focused Developer Conference",
        "link": "https://www.redherring.com/internet/alphabet-shares-jump-after-ai-focused-developer-conference/",
        "source": "Red Herring",
        "source_date": "May 12 2023, 02:00 AM UTC-05:00",
        "date": "May 11 2023, 03:00 PM UTC-05:00",
        "price_movement": {
          "percentage": 0.043131992,
          "movement": "Up"
        }
      }
    },
    ...
  ]
}