Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

گرفتن تمام نمادهای بازار #226

Open
sfmqrb opened this issue Sep 28, 2023 · 2 comments
Open

گرفتن تمام نمادهای بازار #226

sfmqrb opened this issue Sep 28, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@sfmqrb
Copy link
Collaborator

sfmqrb commented Sep 28, 2023

خوبه که بتونیم با یه دستور تمامی نمادها رو اسمشون و یه سری اطلاعات دیگه رو بگیریم.
شاخص ها و سهام‌ها و حق تقدم ها و اختیار خرید و فروش ها و ... .

@sfmqrb sfmqrb added the enhancement New feature or request label Sep 28, 2023
@farbodhma
Copy link

سلام من کد این بخش رو زدم و دارم و اگر تیم بخواد میتونم در اختیار قرار بدم

@farbodhma
Copy link

import requests
import json
import re

def browserHeaders():
    return {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
            'Accept-Language': 'en-US,en;q=0.9',
            'Accept-Encoding': 'gzip, deflate',
            'Connection': 'keep-alive',
            'Upgrade-Insecure-Requests': '1',
            'Ref'
            'erer': 'https://www.google.com/',
    }

def makeRequest(url, headers = browserHeaders(), resDataType = 'json'):
    res = requests.get(url, headers=headers)
    if resDataType == 'json':
        res = res.json()
    else:


        res = res.text
    return res

def getSymbolsBasicInfo():
    url = "https://search.codal.ir/api/search/v2/q?&Audited=true&AuditorRef=-1&Category=-1&Childs=true&CompanyState=-1&CompanyType=-1&Consolidatable=true&IsNotAudited=false&Length=-1&LetterType=-1&Mains=true&NotAudited=true&NotConsolidatable=true&PageNumber=1&Publisher=false&TracingNo=-1&search=false"
    res = makeRequest(url)
    return res
def getSymbolsNames():
    url = "https://www.bourseview.com/public/v1/tickers"
    res = makeRequest(url)
    return res

data = getSymbolsNames()['tickers']
print(data)
adad = 0
for i in data:
   if adad%4==0:
       print(i)
   adad +=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants