π³ Docker Hub | π RapidAPI
- π Update 8/24/2024 - We now support fetch latest news and blogs from page.
- π Update 8/12/2024 - We now support fetch futures list by /futures/all.
- π Update 7/23/2024 - We refactor new /table_v2 API and offer python script turn params into openapi schema.
- π Update 6/11/2024 - We now support login with your own Elite account and can fetch Elite's real-time data.
Finviz offers a fantastic screener application, but it lacks exposed APIs and is server-rendered. Therefore, I developed a server to fetch pages from Finviz and parse them to extract relevant information. I hope this can assist you in your financial research.
- Simply run the
main.gofile. By default, it will listen on port 8000. - Use Docker to run the image
docker run -p 8000:8000 ppaanngggg/finviz-proxy. - Utilize my RapidAPI service, Finviz Screener.
PORT(default: 8000) - the listening port.TIMEOUT(default: 60s) - this is the http client timeout.THROTTLE(default: 100) - this represents the maximum number of concurrent requests.CACHETTL(default: 60s) - this is the table cache timeout.
ELITELOGIN(default: false) - determines if Elite Account login is enabled.EMAIL(default: ) - email of your Elite Account.PASSWORD(default: ) - password of your Elite Account.
This endpoint provides all the necessary parameters to make requests to the Finviz screener.
Request:
No parameters required.
# curl example
curl localhost:8000/paramsResponse:
sorters- determines the sorting method for results.signals- a special filter defined by Finviz for signals.filters- all available filters of the Finviz screener.
// output sample of `/params`
{
"filters": [
{
"id": "fs_exch",
"name": "Exchange",
"description": "Stock Exchange at which a stock is listed.",
"options": [
{
"name": "AMEX",
"value": "exch_amex"
},
...
]
},
{
"id": "fs_idx",
"name": "Index",
"description": "A major index membership of a stock.",
"options": [
{
"name": "S&P 500",
"value": "idx_sp500"
},
...
]
},
...
],
"sorters": [
{
"name": "Ticker",
"value": "ticker"
},
...
],
"signals": [
{
"name": "Top Gainers",
"value": "ta_topgainers"
},
...
]
}This endpoint returns a structured table with the screener results based on the provided parameters.
You can use any value from the API response of /params to manage your /table response.
Request:
π₯³ New V2
Send a POST request to /table_v2 , the field of request body are:
order: Select values fromsorters. For example:"order": ticker.desc: Set totrueorfalseto control the sort order. For example,"desc": true.signal: Select values fromsignals. For example,"signal": ta_topgainers.filters: Select id and value fromfilters. For example,"fs_exch": "exch_nasd".
curl -XPOST 'http://localhost:8000/table_v2' --data '{
"order": "ticker",
"desc": true,
"signal": "ta_topgainers",
"filters": {
"fs_exch": "exch_nasd"
}
}'β Deprecated V1
Send a GET request to /table. The supported parameters are:
order: Select values fromsorters. For example:order=ticker.desc: Set totrueorfalseto control the sort order. For example,desc=true.signal: Select values fromsignals. For example,signal=ta_topgainers.filters: Filters offer various options and can accept multiple values. Select values fromfilters. For instance, usefilters=exch_nasdfor a single value orfilters=exch_nasd&filters=idx_sp500for multiple filters.
curl 'localhost:8000/table?order=ticker&desc=true&signal=ta_topgainers&filters=exch_nasd&filters=idx_sp500'Response:
headers: A list of strings representing the headers fetched from a webpage's table.rows: A list of tuples, where each tuple is an ordered record fetched from a webpage's table.
// output example
{
"headers": [
"No.",
"Ticker",
"Company",
"Sector",
"Industry",
"Country",
"Market Cap",
"P/E",
"Price",
"Change",
"Volume"
],
"rows": [
[
"1",
"FSLR",
"First Solar Inc",
"Technology",
"Solar",
"USA",
"31.53B",
"30.88",
"294.53",
"5.26%",
"4,099,119"
],
[
"2",
"AAPL",
"Apple Inc",
"Technology",
"Consumer Electronics",
"USA",
"3176.46B",
"32.21",
"207.15",
"7.26%",
"172,010,601"
]
]
}