Import Chartink data into Python

Import Chartink data into Python 


    Importing Chartink data into Python allows traders, investors, and finance enthusiasts to harness the power of this popular technical analysis platform for in-depth data analysis. In this guide, we will explore the process of seamlessly integrating Chartink data into Python, enabling users to leverage its extensive financial datasets. We will cover essential steps such as accessing Chartink APIs, retrieving historical and real-time data, and performing data cleaning and preprocessing. By the end, you will have the knowledge to import and analyze Chartink data within Python, empowering you to make informed decisions and gain valuable insights in the world of finance.

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 :-






Comments

  1. Thankyou, can you please make script to import Chartink scan result to Google sheet

    ReplyDelete
  2. Hi there,

    Thank 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

    ReplyDelete
  3. not working ( {cash} (latest rsi (14) > 60 )) .what we can do

    ReplyDelete
  4. scan_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

    this is not working in the ur code, please help

    ReplyDelete
  5. My deepest Gratitude for sharing this sample. This is incredable help for the community. Kudos. and thanks again.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to develop Screener in Pine Script TradingView

Import Nifty Option Chain With Python