Google Finance Markets API

Our Google Finance Markets API allows you to scrape results from the Google Finance Markets page. The API is accessed through the following endpoint: /search?engine=google_finance_markets. A user may query the following: https://serpapi.com/search?engine=google_finance_markets utilizing a GET request. Head to the playground for a live and interactive demo.

API Parameters

Search Query

trend

Required

Parameter is used for retrieving different market trends. Available options:

indexes - Market indexes
most-active - Most active
gainers - Gainers
losers - Losers
climate-leaders - Climate leaders
cryptocurrencies - Crypto
currencies - Currencies

Localization

hl

Optional

Parameter defines the language to use for the Google Finance Markets 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

index_market

Optional

Parameter is used for expanding market indexes by region and retrieving more results. Available options:

americas - Americas
europe-middle-east-africa - Europe, Middle East, and Africa
asia-pacific - Asia Pacific

Parameter can be used only when trend parameter is set to: indexes.

Serpapi Parameters

engine

Required

Set parameter to google_finance_markets to use the Google Finance Markets API engine.

no_cache

Optional

Parameter will force SerpApi to fetch the Google Finance Markets 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", "Market Trends", "News Results", 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

JSON structure overview

{
  "markets": {
    "us": [
      {
        "stock": "String - Short name of the stock or index",
        "link": "String - Link to the stock or index page",
        "serpapi_link": "String - Link to the SerpApi search",
        "name": "String - Name of the stock or index",
        "price": "Float - Price value",
        "currency": "String - Type of currency",
        "price_movement": {
          "percentage": "Float - Price movement in percentages",
          "value": "Float - Price movement",
          "movement": "String - Can be 'Up' or 'Down'",
        }
      },
      ...
    ],
    "top_news": {
      "link": "String - Link to the article",
      "snippet": "String - Short description of the article",
      "source": "String - Article source",
      "date": "String - Article date"
    },
    ...
  },
  "market_trends": [
    {
      "title": "String - Market trends section title",
      "subtitle": "String - Market trends section subtitle",
      "link": "String - Market trends link",
      "serpapi_link": "String - SerpApi link to expanded section results",
      "results": [
        {
          "stock": "String - Short name of the stock or index",
          "link": "String - Link to the stock or index page",
          "serpapi_link": "String - Link to the SerpApi search",
          "name": "String - Name of the stock or index",
          "price": "String - Price value",
          "extracted_price": "Float - Extracted price value",
          "currency": "String - Type of currency",
          "price_movement": {
            "percentage": "Float - Price movement in percentages",
            "value": "Float - Price movement",
            "movement": "String - Can be 'Up' or 'Down'"
          }
        },
        ...
      ],
    },
    ...
  ],
  "news_results": [
    {
      "source": "String - Article source",
      "link": "String - Link to the article",
      "date": "String - Article date",
      "snippet": "String - Short description of the article",
      "thumbnail": "String - Article thumbnail",
      "stocks": [
        {
          "name": "String - Name of the stock or index",
          "link": "String - Google Finance link",
          "serpapi_link": "String - Link to the SerpApi search",
          "stock": "String - Short name of the stock or index",
          "price_movement": {
            "percentage": "Float - Price movement in percentages",
            "movement": "String - Can be 'Up' or 'Down'"
          }
        },
        ...
      ]
    },
    ...
  ],
  "discover_more": [
    {
      "title": "String - Section title",
      "items": [
        {
          "stock": "String - Short name of the stock or index",
          "link": "String - Link to the stock or index page",
          "serpapi_link": "String - Link to the SerpApi search",
          "name": "String - Name of the stock or index",
          "price": "String - Price value",
          "extracted_price": "Float - Extracted price value",
          "currency": "String - Type of currency",
          "price_movement": {
            "percentage": "Float - Price movement in percentages",
            "movement": "String - Can be 'Up' or 'Down'"
          }
        },
        ...
      ]
    },
    ...
  ]
}

Example with trend: indexes

Example with trend: indexes

JSON Example

{
  "search_metadata": {
    "id": "63592f11de983400ab4e1971",
    "status": "Success",
    "json_endpoint": "https://serpapi.com/searches/4f8de8fa23e13899/63592f11de983400ab4e1971.json",
    "created_at": "2022-10-26 12:58:57 UTC",
    "processed_at": "2022-10-26 12:58:58 UTC",
    "google_finance_markets_url": "https://www.google.com/finance/markets/indexes?hl=en",
    "raw_html_file": "https://serpapi.com/searches/4f8de8fa23e13899/63592f11de983400ab4e1971.html",
    "total_time_taken": 1.80
  },
  "search_parameters": {
    "engine": "google_finance_markets",
    "trend": "indexes",
    "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": 31836.74,
        "price_movement": {
          "percentage": 0,
          "value": 0
        }
      },
      ...
    ],
    "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:INDEXDB",
        "name": "DAX",
        "price": 13051.79,
        "price_movement": {
          "percentage": 0.0089628855,
          "value": 1.1699219,
          "movement": "Down"
        }
      },
      ...
    ],
    "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:INDEXNIKKEI",
        "name": "Nikkei 225",
        "price": 27431.84,
        "price_movement": {
          "percentage": 0.66627043,
          "value": 181.56055,
          "movement": "Up"
        }
      },
      ...
    ],
    "currencies": [
      {
        "stock": "USD-IDR",
        "link": "https://www.google.com/finance/quote/USD-IDR",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=USD-IDR",
        "name": "USD / IDR",
        "price": 15574.800000000001,
        "price_movement": {
          "percentage": 0.11441794690493726,
          "value": 17.80000000000109,
          "movement": "Up"
        }
      },
      ...
    ],
    "crypto": [
      {
        "stock": "BTC-IDR",
        "link": "https://www.google.com/finance/quote/BTC-IDR",
        "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=BTC-IDR",
        "name": "Bitcoin (BTC / IDR)",
        "price": 320035662.8,
        "price_movement": {
          "percentage": 2.4176346965213646,
          "value": 7554649.399999976,
          "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:CBOT",
        "name": "E-mini Dow ($5)",
        "price": 31773,
        "currency": "USD",
        "price_movement": {
          "percentage": 0.32625404,
          "value": 104,
          "movement": "Down"
        }
      },
      ...
    ]
  },
  "market_trends": [
    {
      "title": "Americas",
      "link": "https://www.google.com/finance/markets/indexes/americas",
      "serpapi_link": "https://serpapi.com/search.json?engine=google_finance_markets&hl=en&index_market=americas&trend=indexes",
      "results": [
        {
          "stock": ".INX:INDEXSP",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=.INX:INDEXSP",
          "link": "https://www.google.com/finance/quote/.INX:INDEXSP",
          "name": "S&P 500",
          "price": "3,859.11",
          "extracted_price": 3859.11,
          "price_movement": {
            "percentage": 0,
            "value": 0
          }
        },
        ...
      ]
    },
    {
      "title": "Europe, Middle East, and Africa",
      "link": "https://www.google.com/finance/markets/indexes/europe-middle-east-africa",
      "serpapi_link": "https://serpapi.com/search.json?engine=google_finance_markets&hl=en&index_market=europe-middle-east-africa&trend=indexes",
      "results": [
        {
          "stock": "DAX:INDEXDB",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=DAX:INDEXDB",
          "link": "https://www.google.com/finance/quote/DAX:INDEXDB",
          "name": "DAX PERFORMANCE-INDEX",
          "price": "13,051.79",
          "extracted_price": 13051.79,
          "price_movement": {
            "percentage": 0.009,
            "value": 1.17,
            "movement": "Down"
          }
        },
        ...
      ]
    },
    {
      "title": "Asia Pacific",
      "link": "https://www.google.com/finance/markets/indexes/asia-pacific",
      "serpapi_link": "https://serpapi.com/search.json?engine=google_finance_markets&hl=en&index_market=asia-pacific&trend=indexes",
      "results": [
        {
          "stock": "NI225:INDEXNIKKEI",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=NI225:INDEXNIKKEI",
          "link": "https://www.google.com/finance/quote/NI225:INDEXNIKKEI",
          "name": "Nikkei 225",
          "price": "27,431.84",
          "extracted_price": 27431.84,
          "price_movement": {
            "percentage": 0.67,
            "value": 181.56,
            "movement": "Up"
          }
        },
        ...
      ]
    }
  ],
  "news_results": [
    {
      "source": "CNBC",
      "link": "https://www.cnbc.com/2022/10/26/asia-markets-australia-cpi-inflation-stocks-currencies-yields.html",
      "date": "4 hours ago",
      "snippet": "Hang Seng rebounds slightly as Asia markets rise; Australia inflation hits highest in 32 years",
      "thumbnail": "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS4ys9RazQvLoJzUCECc0qZwh_NVIArhZPzQgaw9qhQTrVE_j1zbvGEGVXlbu8",
      "stocks": [
        {
          "name": "Hang Seng Index",
          "link": "https://www.google.com./quote/HSI:INDEXHANGSENG",
          "stock": "HSI:INDEXHANGSENG",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=HSI:INDEXHANGSENG",
          "price_movement": {
            "percentage": 1,
            "movement": "Up"
          }
        }
      ]
    },
    {
      "source": "Investor's Business Daily",
      "link": "https://www.investors.com/market-trend/stock-market-today/dow-jones-futures-microsoft-google-fall-on-earnings-market-rally-runs-to-key-test/",
      "date": "37 minutes ago",
      "snippet": "Dow Jones Futures: Microsoft, Google Fall On Earnings; Market Rally Runs Up To Key Test | Investor's Business Daily",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcTRZGwl4fqWNgZv7oDoxMRSLK7y99-6kCcVuIMqwTP60Z6yuxbYdKMIqJfFQG4",
      "stocks": [
        {
          "name": "Alphabet Inc Class A",
          "link": "https://www.google.com./quote/GOOGL:NASDAQ",
          "stock": "GOOGL:NASDAQ",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=GOOGL:NASDAQ",
          "price_movement": {
            "percentage": 0
          }
        },
        {
          "name": "Microsoft Corporation",
          "link": "https://www.google.com./quote/MSFT:NASDAQ",
          "stock": "MSFT:NASDAQ",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=MSFT:NASDAQ",
          "price_movement": {
            "percentage": 0
          }
        },
        {
          "name": "Dow Jones Industrial Average",
          "link": "https://www.google.com./quote/.DJI:INDEXDJX",
          "stock": ".DJI:INDEXDJX",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=.DJI:INDEXDJX",
          "price_movement": {
            "percentage": 0
          }
        }
      ]
    },
    {
      "source": "Bloomberg.com",
      "link": "https://www.bloomberg.com/news/articles/2022-10-25/asia-stocks-set-to-rise-on-us-rally-dip-in-yields-markets-wrap",
      "date": "14 hours ago",
      "snippet": "Stock Market Today: Dow, S&P Live Updates for Oct. 26",
      "thumbnail": "https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcShz9w3auaW8TJiOtzxZ3DRX6I27Nt6vzEI8cRs5S6wzWHjnqo74XFG9Db_3aI",
      "stocks": [
        {
          "name": "S&P 500",
          "link": "https://www.google.com./quote/.INX:INDEXSP",
          "stock": ".INX:INDEXSP",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=.INX:INDEXSP",
          "price_movement": {
            "percentage": 0
          }
        },
        {
          "name": "Dow Jones Industrial Average",
          "link": "https://www.google.com./quote/.DJI:INDEXDJX",
          "stock": ".DJI:INDEXDJX",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=.DJI:INDEXDJX",
          "price_movement": {
            "percentage": 0
          }
        }
      ]
    },
    ...
  ],
  "discover_more": [
    {
      "title": "You may be interested in",
      "items": [
        {
          "stock": "COMPOSITE:IDX",
          "link": "https://www.google.com/finance/quote/COMPOSITE:IDX",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=COMPOSITE:IDX",
          "name": "IDX Composite",
          "price": "7,043.94",
          "extracted_price": 7043.94,
          "price_movement": {
            "percentage": 0.063,
            "movement": "Down"
          }
        },
        {
          "stock": "ANTM:IDX",
          "link": "https://www.google.com/finance/quote/ANTM:IDX",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=COMPOSITE:IDX",
          "name": "Aneka Tambang Tbk PT",
          "price": "Rp 1,810.00",
          "extracted_price": 1810,
          "currency": "Rp ",
          "price_movement": {
            "percentage": 2.26,
            "movement": "Up"
          }
        },
        {
          "stock": "LQ45:IDX",
          "link": "https://www.google.com/finance/quote/LQ45:IDX",
          "serpapi_link": "https://serpapi.com/search.json?engine=google_finance&hl=en&q=COMPOSITE:IDX",
          "name": "LQ45",
          "price": "1,004.18",
          "extracted_price": 1004.18,
          "price_movement": {
            "percentage": 0.16,
            "movement": "Down"
          }
        },
        ...
      ]
    },
    ...
  ]
}