finnhub-ts
Version:
OpenAPI client for finnhub-ts
926 lines • 405 kB
JSON
{
"swagger": "2.0",
"info": {
"version": "1.0.0",
"title": "Finnhub API",
"license": {
"name": "Apache-2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"host": "finnhub.io",
"basePath": "/api/v1",
"schemes": [
"https"
],
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"name": "token",
"in": "query"
}
},
"extraDocs": [
{
"section": null,
"subSection": [
{
"navHeader": "Introduction",
"urlId": "introduction",
"summary": "API Documentation",
"description": "<p class=\"lead\">The API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. This is 1 of the most comprehensive financial API available on the market.</p> <p><strong>Base URL</strong>: <code>/api/v1</code></p><p><strong>Swagger schema</strong>: <a target=\"_blank\" href=\"/static/swagger.json\">Download</a></p>"
},
{
"navHeader": "Authentication",
"urlId": "authentication",
"summary": "Authentication",
"description": "<p>All GET request require a token parameter <code>token=apiKey</code> in the URL or a header <code>X-Finnhub-Token : apiKey</code>. You can find your API Key under <a target=\"_blank\" href=\"/dashboard\">Dashboard</a>. If you are logged in, your API key will be automatically used in the examples so you can copy and paste them as is.</p>"
},
{
"navHeader": "Limits",
"urlId": "rate-limit",
"summary": "Rate Limits",
"description": "<p>If your limit is exceeded, you will receive a response with status code <code>429</code>.</p><p>On top of all plan's limit, there is a 30 API calls/ second limit.</p>"
},
{
"navHeader": "Sandbox",
"urlId": "sandbox",
"newEndpoint": "New Endpoint",
"summary": "Testing Sandbox",
"description": "<p>All account will have access to free sandbox for testing. To access sandbox mode, simply use your <code>Sandbox API key</code> in <a href=\"/dashboard\">Dashboard</a>. Sandbox environment has <code>60 calls/minute</code> limit. You can test all premium endpoints with sandbox mode. </p>"
},
{
"navHeader": "Webhook",
"urlId": "webhook",
"summary": "Webhook",
"highUsage": "High Usage",
"description": "Subscribe to webhook events. You can setup webhook and test it in <a target=\"_blank\" href=\"/dashboard\">Dashboard</a>. Each user can subscribe up to 50 events.",
"method": [
"GET,POST"
],
"examples": [
{
"url": "/",
"text": "/webhook:action"
}
],
"arguments": null,
"responseAttributes": [
{
"name": "event",
"type": "string",
"description": "Event type. We support real-time <code>earnings</code> events for US stocks at the moment."
},
{
"name": "data",
"type": "list",
"description": "List of events."
}
],
"sampleCode": {
"autoGenerated": false,
"javascript": "",
"go": "",
"python": "import requests\n\n# Register new webhook for earnings\nr = requests.post('https://finnhub.io/api/v1/webhook/add?token=<token>', json={'event': 'earnings', 'symbol': 'AAPL'})\nres = r.json()\nprint(res)\n\nwebhook_id = res['id']\n# List webhook\nr = requests.get('https://finnhub.io/api/v1/webhook/list?token=<token>')\nres = r.json()\nprint(res)\n\n#Delete webhook\nr = requests.post('https://finnhub.io/api/v1/webhook/delete?token=<token>', json={'id': webhook_id})\nres = r.json()\nprint(res)\n\n"
},
"sampleResponse": ""
}
]
},
{
"section": "Open Source",
"subSection": [
{
"navHeader": "Libraries",
"urlId": "library",
"summary": "Libraries",
"description": "<p>We have been incredibly humbled by the support of the open-source community. Beside these incredible projects, here are our own official libraries: </p><table class=\"table table-hover\">\n <thead>\n <tr>\n <th>Language</th>\n <th>Homepage</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"text-blue\">Python</th>\n <td><a href=\"https://github.com/Finnhub-Stock-API/finnhub-python\" target=\"_blank\" rel=\"noopener nofollow\">finnhub-python</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">Go</th>\n <td><a href=\"https://github.com/Finnhub-Stock-API/finnhub-go\" target=\"_blank\" rel=\"noopener nofollow\">finnhub-go</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">Javascript</th>\n <td><a href=\"https://www.npmjs.com/package/finnhub\" target=\"_blank\" rel=\"noopener nofollow\">Finnhub NPM</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">Ruby</th>\n <td><a href=\"https://github.com/Finnhub-Stock-API/finnhub-ruby\" target=\"_blank\" rel=\"noopener nofollow\">Finnhub Ruby</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">Kotlin</th>\n <td><a href=\"https://github.com/Finnhub-Stock-API/finnhub-kotlin\" target=\"_blank\" rel=\"noopener nofollow\">Finnhub Kotlin</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">PHP</th>\n <td><a href=\"https://packagist.org/packages/finnhub/client\" target=\"_blank\" rel=\"noopener nofollow\">Finnhub PHP</a></td>\n </tr>\n </tbody>\n</table>"
},
{
"navHeader": "Open Data",
"urlId": "open-data",
"summary": "Open Data",
"description": "<p>We understand the importance of data for students, researchers,and investors. That's why at Finnhub, we have decided to create multiple Open Datasets for the community which can be downloaded in bulk below:</p><table class=\"table table-hover\">\n <thead>\n <tr>\n <th>Datasets</th>\n <th>Download</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td class=\"text-blue\">SEC Financials As Reported</th>\n <td><a href=\"https://www.kaggle.com/finnhub/reported-financials\" target=\"_blank\" rel=\"noopener\">Kaggle</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">SEC Filings Metadata</th>\n <td><a href=\"https://www.kaggle.com/finnhub/sec-filings\" target=\"_blank\" rel=\"noopener\">Kaggle</a></td>\n </tr>\n <tr>\n <td class=\"text-blue\">S&P 500 futures tick data</th>\n <td><a href=\"https://www.kaggle.com/finnhub/sp-500-futures-tick-data-sp\" target=\"_blank\" rel=\"noopener\">Kaggle</a></td>\n </tr>\n </tbody>\n</table>"
}
]
},
{
"section": "Websocket",
"subSection": [
{
"navHeader": "Trades",
"urlId": "websocket-trades",
"summary": "Trades - Last Price Updates",
"title": "Websocket - Realtime streaming for US Full SIP, LSE, Forex and Crypto",
"highUsage": "High Usage",
"description": "Stream real-time trades for US stocks, forex and crypto. Trades might not be available for some forex and crypto exchanges. In that case, a price update will be sent with volume = 0. A message can contain multiple trades. 1 API key can only open 1 connection at a time. Real-time US market data is provided by IEX. Cross-connect and real-time data for international markets are available for Enterprise clients via our partners. <a href=\"mailto:support@finnhub.io\">Contact us</a> to learn more.",
"method": [
"Websocket"
],
"examples": [
{
"url": "wss://ws.finnhub.io?token=<token>",
"text": "wss://ws.finnhub.io"
}
],
"arguments": null,
"responseAttributes": [
{
"name": "type",
"type": "string",
"description": "Message type."
},
{
"name": "data",
"type": "list",
"description": "List of trades or price updates.",
"item": {
"type": "object",
"definition": "Trade",
"attributes": [
{
"name": "s",
"type": "string",
"description": "Symbol."
},
{
"name": "p",
"type": "float",
"description": "Last price."
},
{
"name": "t",
"type": "int",
"description": "UNIX milliseconds timestamp."
},
{
"name": "v",
"type": "float",
"description": "Volume."
},
{
"name": "c",
"type": "list",
"description": "List of trade conditions. A comprehensive list of trade conditions code can be found <a target=\"_blank\" href=\"https://docs.google.com/spreadsheets/d/1PUxiSWPHSODbaTaoL2Vef6DgU-yFtlRGZf19oBb9Hp0/edit?usp=sharing\">here</a>",
"item": {
"type": "string"
}
}
]
}
}
],
"sampleCode": {
"autoGenerated": false,
"javascript": "const socket = new WebSocket('wss://ws.finnhub.io?token=<token>');\n\n// Connection opened -> Subscribe\nsocket.addEventListener('open', function (event) {\n socket.send(JSON.stringify({'type':'subscribe', 'symbol': 'AAPL'}))\n socket.send(JSON.stringify({'type':'subscribe', 'symbol': 'BINANCE:BTCUSDT'}))\n socket.send(JSON.stringify({'type':'subscribe', 'symbol': 'IC MARKETS:1'}))\n});\n\n// Listen for messages\nsocket.addEventListener('message', function (event) {\n console.log('Message from server ', event.data);\n});\n\n// Unsubscribe\n var unsubscribe = function(symbol) {\n socket.send(JSON.stringify({'type':'unsubscribe','symbol': symbol}))\n}\n",
"go": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/gorilla/websocket\"\n)\n\nfunc main() {\n\tw, _, err := websocket.DefaultDialer.Dial(\"wss://ws.finnhub.io?token=<token>\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer w.Close()\n\n\tsymbols := []string{\"AAPL\", \"AMZN\", \"BINANCE:BTCUSDT\", \"IC MARKETS:1\"}\n\tfor _, s := range symbols {\n\t\tmsg, _ := json.Marshal(map[string]interface{}{\"type\": \"subscribe\", \"symbol\": s})\n\t\tw.WriteMessage(websocket.TextMessage, msg)\n\t}\n\n\tvar msg interface{}\n\tfor {\n\t\terr := w.ReadJSON(&msg);\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(\"Message from server \", msg)\n\t}\n}\n",
"python": "#https://pypi.org/project/websocket_client/\nimport websocket\n\ndef on_message(ws, message):\n print(message)\n\ndef on_error(ws, error):\n print(error)\n\ndef on_close(ws):\n print(\"### closed ###\")\n\ndef on_open(ws):\n ws.send('{\"type\":\"subscribe\",\"symbol\":\"AAPL\"}')\n ws.send('{\"type\":\"subscribe\",\"symbol\":\"AMZN\"}')\n ws.send('{\"type\":\"subscribe\",\"symbol\":\"BINANCE:BTCUSDT\"}')\n ws.send('{\"type\":\"subscribe\",\"symbol\":\"IC MARKETS:1\"}')\n\nif __name__ == \"__main__\":\n websocket.enableTrace(True)\n ws = websocket.WebSocketApp(\"wss://ws.finnhub.io?token=<token>\",\n on_message = on_message,\n on_error = on_error,\n on_close = on_close)\n ws.on_open = on_open\n ws.run_forever()"
},
"sampleResponse": " {\"data\":[{\"p\":7296.89,\"s\":\"BINANCE:BTCUSDT\",\"t\":1575526691134,\"v\":0.011467}],\"type\":\"trade\"}\n\n"
},
{
"navHeader": "News",
"title": "Websocket - Realtime News Streaming",
"urlId": "websocket-news",
"summary": "News",
"premium": "Premium Access Required",
"description": "Stream real-time news for US and Canadian stocks.",
"method": [
"Websocket"
],
"examples": [
{
"url": "wss://ws.finnhub.io?token=<token>",
"text": "wss://ws.finnhub.io"
}
],
"arguments": null,
"responseAttributes": [
{
"name": "type",
"type": "string",
"description": "Message type: <code>news</code>."
},
{
"name": "data",
"type": "list",
"description": "List of news.",
"item": {
"type": "object",
"definition": "News",
"attributes": [
{
"name": "category",
"type": "string",
"description": "News category."
},
{
"name": "datetime",
"type": "timestamp",
"description": "Published time in UNIX timestamp."
},
{
"name": "headline",
"type": "string",
"description": "News headline."
},
{
"name": "urlId",
"type": "int",
"description": "News ID."
},
{
"name": "image",
"type": "string",
"description": "Thumbnail image URL."
},
{
"name": "related",
"type": "string",
"description": "Related stocks and companies mentioned in the article."
},
{
"name": "source",
"type": "string",
"description": "News source."
},
{
"name": "summary",
"type": "string",
"description": "News summary."
},
{
"name": "url",
"type": "string",
"description": "URL of the original article."
}
]
}
}
],
"sampleCode": {
"autoGenerated": false,
"javascript": "const socket = new WebSocket('wss://ws.finnhub.io?token=<token>');\n\n// Connection opened -> Subscribe\nsocket.addEventListener('open', function (event) {\n socket.send(JSON.stringify({'type':'subscribe-news', 'symbol': 'AAPL'}))\n socket.send(JSON.stringify({'type':'subscribe-news', 'symbol': 'MSFT'}))\n socket.send(JSON.stringify({'type':'subscribe-news', 'symbol': 'AMZN'}))\n});\n\n// Listen for messages\nsocket.addEventListener('message', function (event) {\n console.log('Message from server ', event.data);\n});\n\n// Unsubscribe\n var unsubscribe = function(symbol) {\n socket.send(JSON.stringify({'type':'unsubscribe-news','symbol': symbol}))\n}\n",
"go": "package main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/gorilla/websocket\"\n)\n\nfunc main() {\n\tw, _, err := websocket.DefaultDialer.Dial(\"wss://ws.finnhub.io?token=<token>\", nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer w.Close()\n\n\tsymbols := []string{\"AAPL\", \"AMZN\", \"MSFT\", \"BYND\"}\n\tfor _, s := range symbols {\n\t\tmsg, _ := json.Marshal(map[string]interface{}{\"type\": \"subscribe-news\", \"symbol\": s})\n\t\tw.WriteMessage(websocket.TextMessage, msg)\n\t}\n\n\tvar msg interface{}\n\tfor {\n\t\terr := w.ReadJSON(&msg);\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tfmt.Println(\"Message from server \", msg)\n\t}\n}\n",
"python": "#https://pypi.org/project/websocket_client/\nimport websocket\n\ndef on_message(ws, message):\n print(message)\n\ndef on_error(ws, error):\n print(error)\n\ndef on_close(ws):\n print(\"### closed ###\")\n\ndef on_open(ws):\n ws.send('{\"type\":\"subscribe-news\",\"symbol\":\"AAPL\"}')\n ws.send('{\"type\":\"subscribe-news\",\"symbol\":\"AMZN\"}')\n ws.send('{\"type\":\"subscribe-news\",\"symbol\":\"MSFT\"}')\n ws.send('{\"type\":\"subscribe-news\",\"symbol\":\"BYND\"}')\n\nif __name__ == \"__main__\":\n websocket.enableTrace(True)\n ws = websocket.WebSocketApp(\"wss://ws.finnhub.io?token=<token>\",\n on_message = on_message,\n on_error = on_error,\n on_close = on_close)\n ws.on_open = on_open\n ws.run_forever()"
},
"sampleResponse": " {\"data\":[{\"p\":7296.89,\"s\":\"BINANCE:BTCUSDT\",\"t\":1575526691134,\"v\":0.011467}],\"type\":\"trade\"}\n\n"
}
]
}
],
"orders": [
"/search",
"/stock/symbol",
"/stock/profile",
"/stock/profile2",
"/stock/executive",
"/news",
"/company-news",
"/press-releases",
"/news-sentiment",
"/stock/peers",
"/stock/metric",
"/stock/ownership",
"/stock/fund-ownership",
"/stock/insider-transactions",
"/stock/insider-sentiment",
"/stock/financials",
"/stock/financials-reported",
"/stock/revenue-breakdown",
"/stock/filings",
"/stock/international-filings",
"/stock/filings-sentiment",
"/stock/similarity-index",
"/calendar/ipo",
"/stock/dividend",
"/stock/recommendation",
"/stock/price-target",
"/stock/upgrade-downgrade",
"/stock/revenue-estimate",
"/stock/eps-estimate",
"/stock/ebitda-estimate",
"/stock/ebit-estimate",
"/stock/earnings",
"/calendar/earnings",
"/quote",
"/stock/candle",
"/stock/tick",
"/stock/bbo",
"/stock/bidask",
"/stock/split",
"/stock/dividend2",
"/index/constituents",
"/index/historical-constituents",
"/etf/profile",
"/etf/holdings",
"/etf/sector",
"/etf/country",
"/mutual-fund/profile",
"/mutual-fund/holdings",
"/mutual-fund/sector",
"/mutual-fund/country",
"/bond/profile",
"/bond/price",
"/forex/exchange",
"/forex/symbol",
"/forex/candle",
"/forex/rates",
"/crypto/exchange",
"/crypto/symbol",
"/crypto/profile",
"/crypto/candle",
"/scan/pattern",
"/scan/support-resistance",
"/scan/technical-indicator",
"/indicator",
"/stock/transcripts/list",
"/stock/transcripts",
"/stock/social-sentiment",
"/stock/investment-theme",
"/stock/supply-chain",
"/stock/esg",
"/stock/earnings-quality-score",
"/stock/uspto-patent",
"/stock/visa-application",
"/stock/lobbying",
"/stock/usa-spending",
"/covid19/us",
"/fda-advisory-committee-calendar",
"/country",
"/calendar/economic",
"/economic/code",
"/economic"
],
"sampleCodeTemplate": {
"python": "import finnhub\nfinnhub_client = finnhub.Client(api_key=\"<token>\")\n\n<MY_CODE>\n",
"javascript": "const finnhub = require('finnhub');\n\nconst api_key = finnhub.ApiClient.instance.authentications['api_key'];\napi_key.apiKey = \"<token>\"\nconst finnhubClient = new finnhub.DefaultApi()\n\n<MY_CODE>\n",
"go": "package main\n\nimport (\n \"context\"\n \"fmt\"\n finnhub \"github.com/Finnhub-Stock-API/finnhub-go/v2\"\n)\n\nfunc main() {\n cfg := finnhub.NewConfiguration()\n cfg.AddDefaultHeader(\"X-Finnhub-Token\", \"<token>\")\n finnhubClient := finnhub.NewAPIClient(cfg).DefaultApi\n \n <MY_CODE>\n fmt.Printf(\"%+v\\n\", res)\n}",
"ruby": "require 'finnhub_ruby'\n\nFinnhubRuby.configure do |config|\n config.api_key['api_key'] = '<token>'\nend\n\nfinnhub_client = FinnhubRuby::DefaultApi.new\n<MY_CODE>\n",
"kotlin": "import io.finnhub.api.apis.DefaultApi\nimport io.finnhub.api.infrastructure.ApiClient\n\nApiClient.apiKey[\"token\"] = \"<token>\"\nval apiClient = DefaultApi()\n\n<MY_CODE>\n",
"php": "<?php\n\nrequire_once(__DIR__ . '/vendor/autoload.php');\n\n$config = Finnhub\\Configuration::getDefaultConfiguration()->setApiKey('token', '<token>');\n$client = new Finnhub\\Api\\DefaultApi(\n new GuzzleHttp\\Client(),\n $config\n);\n\n<MY_CODE>\n\n?>"
},
"paths": {
"/search": {
"get": {
"summary": "Symbol Lookup",
"description": "Search for best-matching symbols based on your query. You can input anything from symbol, security's name to ISIN and Cusip.",
"operationId": "symbol-search",
"navHeader": "Symbol Lookup",
"urlId": "symbol-search",
"title": "Global Stocks Search",
"examples": [
{
"url": "/search?q=apple&token=<token>",
"text": "/search?q=apple"
},
{
"url": "/search?q=US5949181045&token=<token>",
"text": "/search?q=US5949181045"
}
],
"widget": null,
"freeTier": null,
"premium": null,
"newEndpoint": null,
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "q",
"description": "Query text can be symbol, name, isin, or cusip.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"$ref": "#/definitions/SymbolLookup"
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.symbol_lookup('apple'))",
"go": "res, _, err := finnhubClient.SymbolSearch(context.Background()).Q(\"AAPL\").Execute()",
"javascript": "finnhubClient.symbolSearch('AAPL', (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.symbol_search('AAPL'))",
"kotlin": "println(apiClient.symbolSearch(\"AAPL\"))",
"php": "print_r($client->symbolSearch(\"AAPL\"));",
"useTemplate": true
},
"sampleResponse": "{\n \"count\": 4,\n \"result\": [\n {\n \"description\": \"APPLE INC\",\n \"displaySymbol\": \"AAPL\",\n \"symbol\": \"AAPL\",\n \"type\": \"Common Stock\"\n },\n {\n \"description\": \"APPLE INC\",\n \"displaySymbol\": \"AAPL.SW\",\n \"symbol\": \"AAPL.SW\",\n \"type\": \"Common Stock\"\n },\n {\n \"description\": \"APPLE INC\",\n \"displaySymbol\": \"APC.BE\",\n \"symbol\": \"APC.BE\",\n \"type\": \"Common Stock\"\n },\n {\n \"description\": \"APPLE INC\",\n \"displaySymbol\": \"APC.DE\",\n \"symbol\": \"APC.DE\",\n \"type\": \"Common Stock\"\n }\n ]\n}",
"security": [
{
"api_key": []
}
]
}
},
"/stock/symbol": {
"get": {
"summary": "Stock Symbol",
"description": "List supported stocks. We use the following symbology to identify stocks on Finnhub <code>Exchange_Ticker.Exchange_Code</code>. A list of supported exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>.",
"operationId": "stock-symbols",
"navHeader": "Stock Symbols",
"urlId": "stock-symbols",
"title": "Stock Symbols By Exchange",
"examples": [
{
"url": "/stock/symbol?exchange=US&token=<token>",
"text": "/stock/symbol?exchange=US"
},
{
"url": "/stock/symbol?exchange=US&mic=XNYS&token=<token>",
"text": "/stock/symbol?exchange=US&mic=XNYS"
}
],
"widget": null,
"freeTier": null,
"premium": null,
"newEndpoint": null,
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "exchange",
"description": "Exchange you want to get the list of symbols from. List of exchange codes can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>.",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "mic",
"description": "Filter by MIC code.",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "securityType",
"description": "Filter by security type used by OpenFigi standard.",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "currency",
"description": "Filter by currency.",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/StockSymbol"
}
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.stock_symbols('US'))",
"go": "res, _, err := finnhubClient.StockSymbols(context.Background()).Exchange(\"US\").Execute()",
"javascript": "finnhubClient.stockSymbols(\"US\", (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.stock_symbols('US'))",
"kotlin": "println(apiClient.stockSymbols(\"US\", \"\", \"\", \"\"))",
"php": "print_r($client->stockSymbols(\"US\"));",
"useTemplate": true
},
"sampleResponse": "[\n {\n \"currency\": \"USD\",\n \"description\": \"UAN POWER CORP\",\n \"displaySymbol\": \"UPOW\",\n \"figi\": \"BBG000BGHYF2\",\n \"mic\": \"OTCM\",\n \"symbol\": \"UPOW\",\n \"type\": \"Common Stock\"\n },\n {\n \"currency\": \"USD\",\n \"description\": \"APPLE INC\",\n \"displaySymbol\": \"AAPL\",\n \"figi\": \"BBG000B9Y5X2\",\n \"mic\": \"XNGS\",\n \"symbol\": \"AAPL\",\n \"type\": \"Common Stock\"\n },\n {\n \"currency\": \"USD\",\n \"description\": \"EXCO TECHNOLOGIES LTD\",\n \"displaySymbol\": \"EXCOF\",\n \"figi\": \"BBG000JHDDS8\",\n \"mic\": \"OOTC\",\n \"symbol\": \"EXCOF\",\n \"type\": \"Common Stock\"\n }\n]",
"security": [
{
"api_key": []
}
]
}
},
"/stock/profile": {
"get": {
"summary": "Company Profile",
"description": "Get general information of a company. You can query by symbol, ISIN or CUSIP",
"operationId": "company-profile",
"navHeader": "Company Profile",
"urlId": "company-profile",
"title": "Global Company Profile",
"examples": [
{
"url": "/stock/profile?symbol=AAPL&token=<token>",
"text": "/stock/profile?symbol=AAPL"
},
{
"url": "/stock/profile?symbol=IBM&token=<token>",
"text": "/stock/profile?symbol=IBM"
},
{
"url": "/stock/profile?isin=US5949181045&token=<token>",
"text": "/stock/profile?isin=US5949181045"
},
{
"url": "/stock/profile?cusip=023135106&token=<token>",
"text": "/stock/profile?cusip=023135106"
}
],
"widget": null,
"freeTier": null,
"premium": "Premium Access Required",
"newEndpoint": null,
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "symbol",
"description": "Symbol of the company: AAPL e.g.",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "isin",
"description": "ISIN",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "cusip",
"description": "CUSIP",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"$ref": "#/definitions/CompanyProfile"
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.company_profile(symbol='AAPL'))",
"go": "res, _, err := finnhubClient.CompanyProfile(context.Background()).Symbol(\"AAPL\").Execute()",
"javascript": "finnhubClient.companyProfile({'symbol': 'AAPL'}, (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.company_profile({symbol: 'AAPL'}))",
"kotlin": "println(apiClient.companyProfile(symbol = \"AAPL\", isin = null, cusip = null))",
"php": "print_r($client->companyProfile(\"AAPL\"));",
"useTemplate": true
},
"sampleResponse": "{\n \"address\": \"1 Apple Park Way\",\n \"city\": \"CUPERTINO\",\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"cusip\": \"\",\n \"sedol\":\"2046251\",\n \"description\": \"Apple Inc. is an American multinational technology company headquartered in Cupertino, California, that designs, develops, and sells consumer electronics, computer software, and online services. It is considered one of the Big Four technology companies, alongside Amazon, Google, and Microsoft. The company's hardware products include the iPhone smartphone, the iPad tablet computer, the Mac personal computer, the iPod portable media player, the Apple Watch smartwatch, the Apple TV digital media player, the AirPods wireless earbuds and the HomePod smart speaker. Apple's software includes the macOS, iOS, iPadOS, watchOS, and tvOS operating systems, the iTunes media player, the Safari web browser, the Shazam acoustic fingerprint utility, and the iLife and iWork creativity and productivity suites, as well as professional applications like Final Cut Pro, Logic Pro, and Xcode. Its online services include the iTunes Store, the iOS App Store, Mac App Store, Apple Music, Apple TV+, iMessage, and iCloud. Other services include Apple Store, Genius Bar, AppleCare, Apple Pay, Apple Pay Cash, and Apple Card.\",\n \"employeeTotal\": \"137000\",\n \"exchange\": \"NASDAQ/NMS (GLOBAL MARKET)\",\n \"ggroup\": \"Technology Hardware & Equipment\",\n \"gind\": \"Technology Hardware, Storage & Peripherals\",\n \"gsector\": \"Information Technology\",\n \"gsubind\": \"Technology Hardware, Storage & Peripherals\",\n \"ipo\": \"1980-12-12\",\n \"isin\": \"\",\n \"marketCapitalization\": 1415993,\n \"naics\": \"Communications Equipment Manufacturing\",\n \"naicsNationalIndustry\": \"Radio and Television Broadcasting and Wireless Communications Equipment Manufacturing\",\n \"naicsSector\": \"Manufacturing\",\n \"naicsSubsector\": \"Computer and Electronic Product Manufacturing\",\n \"name\": \"Apple Inc\",\n \"phone\": \"14089961010\",\n \"shareOutstanding\": 4375.47998046875,\n \"state\": \"CALIFORNIA\",\n \"ticker\": \"AAPL\",\n \"weburl\": \"https://www.apple.com/\",\n \"logo\": \"https://static.finnhub.io/logo/87cb30d8-80df-11ea-8951-00000000092a.png\",\n \"finnhubIndustry\":\"Technology\"\n}",
"security": [
{
"api_key": []
}
]
}
},
"/stock/profile2": {
"get": {
"summary": "Company Profile 2",
"description": "Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href=\"#company-profile\">Company Profile</a>.",
"operationId": "company-profile2",
"navHeader": "Company Profile 2",
"urlId": "company-profile2",
"title": "Global Company Profile 2",
"examples": [
{
"url": "/stock/profile2?symbol=AAPL&token=<token>",
"text": "/stock/profile2?symbol=AAPL"
},
{
"url": "/stock/profile2?isin=US5949181045&token=<token>",
"text": "/stock/profile2?isin=US5949181045"
},
{
"url": "/stock/profile2?cusip=023135106&token=<token>",
"text": "/stock/profile2?cusip=023135106"
}
],
"widget": null,
"freeTier": null,
"premium": null,
"newEndpoint": "New Endpoint",
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "symbol",
"description": "Symbol of the company: AAPL e.g.",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "isin",
"description": "ISIN",
"required": false,
"type": "string"
},
{
"in": "query",
"name": "cusip",
"description": "CUSIP",
"required": false,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"$ref": "#/definitions/CompanyProfile2"
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.company_profile2(symbol='AAPL'))",
"go": "res, _, err := finnhubClient.CompanyProfile2(context.Background()).Symbol(\"AAPL\").Execute()",
"javascript": "finnhubClient.companyProfile2({'symbol': 'AAPL'}, (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.company_profile2({symbol: 'AAPL'}))",
"kotlin": "println(apiClient.companyProfile2(symbol = \"AAPL\", isin = null, cusip = null))",
"php": "print_r($client->companyProfile2(\"AAPL\"));",
"useTemplate": true
},
"sampleResponse": "{\n \"country\": \"US\",\n \"currency\": \"USD\",\n \"exchange\": \"NASDAQ/NMS (GLOBAL MARKET)\",\n \"ipo\": \"1980-12-12\",\n \"marketCapitalization\": 1415993,\n \"name\": \"Apple Inc\",\n \"phone\": \"14089961010\",\n \"shareOutstanding\": 4375.47998046875,\n \"ticker\": \"AAPL\",\n \"weburl\": \"https://www.apple.com/\",\n \"logo\": \"https://static.finnhub.io/logo/87cb30d8-80df-11ea-8951-00000000092a.png\",\n \"finnhubIndustry\":\"Technology\"\n}",
"security": [
{
"api_key": []
}
]
}
},
"/stock/executive": {
"get": {
"summary": "Company Executive",
"description": "Get a list of company's executives and members of the Board.",
"operationId": "company-executive",
"navHeader": "Company Executive",
"urlId": "company-executive",
"title": "Global Company Executives & Compensation",
"examples": [
{
"url": "/stock/executive?symbol=AAPL&token=<token>",
"text": "/stock/executive?symbol=AAPL"
},
{
"url": "/stock/executive?symbol=AMZN&token=<token>",
"text": "/stock/executive?symbol=AMZN"
}
],
"widget": null,
"freeTier": null,
"premium": "Premium Access Required",
"newEndpoint": null,
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "symbol",
"description": "Symbol of the company: AAPL.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "object",
"$ref": "#/definitions/CompanyExecutive"
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.company_executive('AAPL'))",
"go": "res, _, err := finnhubClient.CompanyExecutive(context.Background()).Symbol(\"AAPL\").Execute()",
"javascript": "finnhubClient.companyExecutive('AAPL', (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.company_executive('AAPL'))",
"kotlin": "println(apiClient.companyExecutive(\"AAPL\"))",
"php": "print_r($client->companyExecutive(\"AAPL\"));",
"useTemplate": true
},
"sampleResponse": "{\n \"executive\": [\n {\n \"age\": 56,\n \"compensation\": 25209637,\n \"currency\": \"USD\",\n \"name\": \"Luca Maestri\",\n \"position\": \"Senior Vice President and Chief Financial Officer\",\n \"sex\": \"male\",\n \"since\": \"2014\"\n },\n {\n \"age\": 59,\n \"compensation\": 11555466,\n \"currency\": \"USD\",\n \"name\": \"Mr. Timothy Cook\",\n \"position\": \"Director and Chief Executive Officer\",\n \"sex\": \"male\",\n \"since\": \"2011\"\n }\n ]\n}",
"security": [
{
"api_key": []
}
]
}
},
"/news": {
"get": {
"summary": "Market News",
"description": "Get latest market news.",
"operationId": "market-news",
"navHeader": "Market News",
"urlId": "market-news",
"title": "Real-time Market News API",
"examples": [
{
"url": "/news?category=general&token=<token>",
"text": "/news?category=general"
},
{
"url": "/news?category=forex&minId=10&token=<token>",
"text": "/news?category=forex&minId=10"
}
],
"widget": null,
"freeTier": null,
"premium": null,
"newEndpoint": null,
"highUsage": null,
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "category",
"description": "This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>.",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "minId",
"description": "Use this field to get only news after this ID. Default to 0",
"required": false,
"type": "integer",
"format": "int64"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/MarketNews"
}
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.general_news('general', min_id=0))",
"go": "res, _, err := finnhubClient.MarketNews(context.Background()).Category(\"general\").Execute()",
"javascript": "finnhubClient.marketNews(\"general\", {}, (error, data, response) => {\n console.log(data)\n});",
"ruby": "puts(finnhub_client.market_news('general', {min_id: 0}))",
"kotlin": "println(apiClient.marketNews(\"general\", minId = 0))",
"php": "print_r($client->marketNews(\"forex\", 0));",
"useTemplate": true
},
"sampleResponse": "[\n {\n \"category\": \"technology\",\n \"datetime\": 1596589501,\n \"headline\": \"Square surges after reporting 64% jump in revenue, more customers using Cash App\",\n \"id\": 5085164,\n \"image\": \"https://image.cnbcfm.com/api/v1/image/105569283-1542050972462rts25mct.jpg?v=1542051069\",\n \"related\": \"\",\n \"source\": \"CNBC\",\n \"summary\": \"Shares of Square soared on Tuesday evening after posting better-than-expected quarterly results and strong growth in its consumer payments app.\",\n \"url\": \"https://www.cnbc.com/2020/08/04/square-sq-earnings-q2-2020.html\"\n },\n {\n \"category\": \"business\",\n \"datetime\": 1596588232,\n \"headline\": \"B&G Foods CEO expects pantry demand to hold up post-pandemic\",\n \"id\": 5085113,\n \"image\": \"https://image.cnbcfm.com/api/v1/image/106629991-1595532157669-gettyimages-1221952946-362857076_1-5.jpeg?v=1595532242\",\n \"related\": \"\",\n \"source\": \"CNBC\",\n \"summary\": \"\\\"I think post-Covid, people will be working more at home, which means people will be eating more breakfast\\\" and other meals at home, B&G CEO Ken Romanzi said.\",\n \"url\": \"https://www.cnbc.com/2020/08/04/bg-foods-ceo-expects-pantry-demand-to-hold-up-post-pandemic.html\"\n },\n {\n \"category\": \"top news\",\n \"datetime\": 1596584406,\n \"headline\": \"Anthony Levandowski gets 18 months in prison for stealing Google self-driving car files\",\n \"id\": 5084850,\n \"image\": \"https://image.cnbcfm.com/api/v1/image/106648265-1596584130509-UBER-LEVANDOWSKI.JPG?v=1596584247\",\n \"related\": \"\",\n \"source\": \"CNBC\",\n \"summary\": \"A U.S. judge on Tuesday sentenced former Google engineer Anthony Levandowski to 18 months in prison for stealing a trade secret from Google related to self-driving cars months before becoming the head of Uber Technologies Inc's rival unit.\",\n \"url\": \"https://www.cnbc.com/2020/08/04/anthony-levandowski-gets-18-months-in-prison-for-stealing-google-self-driving-car-files.html\"\n }\n }]",
"security": [
{
"api_key": []
}
]
}
},
"/company-news": {
"get": {
"summary": "Company News",
"description": "List latest company news by symbol. This endpoint is only available for North American companies.",
"operationId": "company-news",
"navHeader": "Company News",
"urlId": "company-news",
"title": "Real-time Global Company News API",
"examples": [
{
"url": "/company-news?symbol=AAPL&from=2021-09-01&to=2021-09-09&token=<token>",
"text": "/company-news?symbol=AAPL&from=2021-09-01&to=2021-09-09"
}
],
"widget": null,
"freeTier": "1 year of historical news and new updates",
"premium": null,
"newEndpoint": null,
"highUsage": "High Usage",
"tags": [
"Default"
],
"section": "Stock Fundamentals",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "query",
"name": "symbol",
"description": "Company symbol.",
"required": true,
"type": "string"
},
{
"in": "query",
"name": "from",
"description": "From date <code>YYYY-MM-DD</code>.",
"required": true,
"type": "string",
"format": "date"
},
{
"in": "query",
"name": "to",
"description": "To date <code>YYYY-MM-DD</code>.",
"required": true,
"type": "string",
"format": "date"
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/CompanyNews"
}
}
}
},
"sampleCode": {
"curl": "autoGenerated",
"python": "print(finnhub_client.company_news('AAPL', _from=\"2020-06-01\", to=\"2020-06-10\"))",
"go": "res, _, err := finnhubClient.CompanyNews(context.Background()).Symbol(\"AAPL\").From(\"2020-05-01\").To(\"2020-05-01\").Execute()",
"javascript": "finnhubClient.companyNews(\"AAPL\", \"2020-01-01\", \"2020-05-01\", (error, data, response) => {\n\tconsole.log(data)\n});",
"ruby": "puts(finnhub_client.company_news('AAPL', \"2020-06-01\", \"2020-06-10\"))",
"kotlin": "println(apiClient.companyNews(\"AAPL\", from = \"2020-06-01\", to = \"2020-06-10\"))",
"php": "print_r($client->companyNews(\"AAPL\", \"2020-06-01\", \"2020-06-10\"));",
"useTemplate": true
},
"sampleResponse": "[\n {\n \"category\": \"company news\",\n \"datetime\": 1569550360,\n \"headline\": \"More sops needed to boost electronic manufacturing: Top govt official More sops needed to boost electronic manufacturing: Top govt official. More sops needed to boost electronic manufacturing: Top govt official More sops needed to boost electronic manufacturing: Top govt official\",\n \"id\": 25286,\n \"image\": \"https://img.etimg.com/thumb/msid-71321314,width-1070,height-580,imgsize-481831,overlay-economictimes/photo.jpg\",\n \"related\": \"AAPL\",\n \"source\": \"The Economic Times India\",\n \"summary\": \"NEW DELHI | CHENNAI: India may have to offer electronic manufacturers additional sops such as cheap credit and incentives for export along with infrastructure support in order to boost production and help the sector compete with China, Vietnam and Thailand, according to a top government official.These incentives, over and above the proposed reduction of corporate tax to 15% for new manufacturing units, are vital for India to successfully attract companies looking to relocate manufacturing facilities.\u201cWhile the tax announcements made last week send a very good signal, in order to help attract investments, we will need additional initiatives,\u201d the official told ET, pointing out that Indian electronic manufacturers incur 8-10% higher costs compared with other Asian countries.Sops that are similar to the incentives for export under the existing Merchandise Exports from India Scheme (MEIS) are what the industry requires, the person said.MEIS gives tax credit in the range of 2-5%. An interest subvention scheme for cheaper loans and a credit guarantee scheme for plant and machinery are some other possible measures that will help the industry, the official added.\u201cThis should be 2.0 (second) version of the electronic manufacturing cluster (EMC) scheme, which is aimed at creating an ecosystem with an anchor company plus its suppliers to operate in the same area,\u201d he said.Last week, finance minister Nirmala Sitharaman announced a series of measures to boost economic growth including a scheme allowing any new manufacturing company incorporated on or after October 1, to pay income tax at 15% provided the company does not avail of any other exemption or incentives.\",\n \"url\": \"https://economictimes.indiatimes.com/industry/cons-products/electronics/more-sops-needed-to-boost-electronic-manufacturing-top-govt-official/articleshow/71321308.cms\"\n },\n {\n \"category\": \"company news\",\n \"datetime\": 1569528720,\n \"headline\": \"How to disable comments on your YouTube videos in 2 different ways\",\n \"id\": 25287,\n \"image\": \"https://amp.businessinsider.com/images/5d8d16182e22af6ab66c09e9-1536-768.jpg\",\n \"related\": \"AAPL\",\n \"source\": \"Business Insider\",\n \"summary\": \"You can disable comments on your own YouTube video if you don't want people to comment on it. It's easy to disable comments on YouTube by adjusting the settings for one of your videos in the beta or classic version of YouTube Studio. Visit Business Insider's homepage for more stories . The comments section has a somewhat complicated reputation for creators, especially for those making videos on YouTube . While it can be useful to get the unfiltered opinions of your YouTube viewers and possibly forge a closer connection with them, it can also open you up to quite a bit of negativity. So it makes sense that there may be times when you want to turn off the feature entirely. Just keep in mind that the action itself can spark conversation. If you decide that you don't want to let pe