Import Chartink data into Python
Import Chartink data into Python
Sample Code :-
import pandas as pd
import requests
from bs4 import BeautifulSoup as bs
url = "https://chartink.com/screener/process"
condition = {"scan_clause" : "( {cash} ( latest rsi( 9 ) > latest wma( latest rsi( 9 ) , 21 ) and 1 day ago rsi( 9 ) <= 1 day ago wma( latest rsi( 9 ) , 21 ) and latest rsi( 9 ) > 70 and market cap > 1500 ) ) "}
with requests.session() as s:
r_data = s.get(url)
soup = bs(r_data.content, "lxml")
meta = soup.find("meta", {"name" : "csrf-token"})["content"]
header = {"x-csrf-token" : meta}
data = s.post(url, headers=header, data=condition).json()
stock_list = pd.DataFrame(data["data"])
print(stock_list)
Video Tutorial :-
Thankyou, can you please make script to import Chartink scan result to Google sheet
ReplyDeleteHi there,
ReplyDeleteThank you for creating such a wondaful content, there is an issue with CRSF token, looks like they are changing the token, its not the same as you showed in the tuts, or am I missing something
not working ( {cash} (latest rsi (14) > 60 )) .what we can do
ReplyDeletescan_clause: ( {33489} ( [0] 5 minute close > 1 day ago low and [0] 5 minute close > 2 days ago low and [0] 5 minute close > latest "( (1 candle ago high + 1 candle ago low + 1 candle ago close / 3 ) * 2 - 1 candle ago high)" and [0] 5 minute close > [0] 5 minute vwap
ReplyDeletethis is not working in the ur code, please help
My deepest Gratitude for sharing this sample. This is incredable help for the community. Kudos. and thanks again.
ReplyDelete