Google Finance API endpoint
Lists the top Google Finance instruments for a ranking metric. `metric` is a Google Finance metric id (default 6) and `page` is the page number (default 1). Each item has its ticker, exchange, name, price, change and change percent, and previous close.
/google/finance/markets/topQuery parameters:
metric: optional Google Finance metric id, defaults to 6page: optional page number, defaults to 1Returns top instruments for the selected metric.
| Field | Filled in, of 6 checked | Values in the sample |
|---|---|---|
| ticker | 6 | “9984” and 5 other values |
| exchange | 6 | TYO (5), INDEXNIKKEI (1) |
| name | 6 | “SoftBank Group Corp” and 5 other values |
| type | 6 | stock (5), index (1) |
| currency | 5 | JPY in all 5 |
| price | 6 | 33 to 67,777.52, median 2,906 |
| change | 6 | -1,253.4 to 69, median -9.5 |
| change_percent | 6 | -8.5 to 1.48, median -1.82 |
| previous_close | 6 | 34 to 69,030.92, median 2,915.5 |
| timezone | 6 | Asia/Tokyo in all 6 |
| google_id | 6 | |
| country | 5 | JP in all 5 |
| last_update_unix | 6 | 1,791,873,903 to 1,791,882,902, median 1,791,882,901 |
| identifier | 6 | “9984:TYO” and 5 other values |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| metric | integer | No | Google Finance metric id | ||
| page | integer | No | Page number | ||
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/google/finance/markets/top?page=1" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"metric": 6,
"page": 1,
"items": [
{
"ticker": "AAPL",
"exchange": "NASDAQ"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/finance.topStocksResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | finance.TopStocksResponse | No | ||||
| data.items | array | No | Top instruments for the selected metric. | |||
| data.items[].after_hours | object | No | Price and change in after-hours trading. | |||
| data.items[].after_hours.change | number | No | -3.37 | Price change, in the same unit as `price`. | ||
| data.items[].after_hours.change_percent | number | No | -1.3 | Price change as a percentage. | ||
| data.items[].after_hours.price | number | No | 255.65 | Price in after-hours trading. | ||
| data.items[].change | number | No | -3.37 | Price change shown by Google Finance, in the same unit as `price`. | ||
| data.items[].change_percent | number | No | -1.3 | Price change as a percentage, as Google Finance shows it. | ||
| data.items[].country | string | No | US | Country code of the instrument, for example `US`. | ||
| data.items[].currency | string | No | USD | Currency code the instrument is priced in, for example `USD`. | ||
| data.items[].exchange | string | No | NASDAQ | Exchange the instrument trades on, for example `NASDAQ`. | ||
| data.items[].google_id | string | No | /m/07zmbvf | Google's id for the instrument, for example `/m/07zmbvf`. | ||
| data.items[].identifier | string | No | AAPL:NASDAQ | Instrument identifier in `TICKER:EXCHANGE` form, for example `AAPL:NASDAQ`. Use it as the `quote` path parameter. | ||
| data.items[].last_update_unix | integer | No | 1777077000 | Time of the latest price update, in Unix seconds. | ||
| data.items[].name | string | No | Apple Inc | Instrument name, for example `Apple Inc`. | ||
| data.items[].previous_close | number | No | 236.35 | Closing price of the previous trading day. | ||
| data.items[].price | number | No | 255.65 | Latest price of the instrument. | ||
| data.items[].ticker | string | No | AAPL | Ticker symbol of the instrument. | ||
| data.items[].timezone | string | No | America/New_York | IANA time zone of the instrument's market, for example `America/New_York`. | ||
| data.items[].type | string | No | stock | Kind of instrument: `stock`, `index`, `crypto`, `etf` or `other`. | ||
| data.metric | integer | No | 6 | Google Finance metric id that was applied. | ||
| data.page | integer | No | 1 | Page number returned. | ||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 500 | Internal Server Error | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/google/finance/markets/top?page=1" \
-H "x-api-key: $CRAWLORA_API_KEY"