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

validate tickers first #88

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

netors
Copy link

@netors netors commented Feb 8, 2025

this change validates the tickers before executing the API calls to prevent costs when entering an invalid ticker

Copy link
Owner

@virattt virattt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this idea, left a comment

Returns a tuple of (is_valid, invalid_tickers).
"""
try:
response = requests.get("https://virattt.github.io/datasets/financials/available_tickers.json")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can just use https://www.sec.gov/files/company_tickers.json

Financial Datasets also has a /tickers/ endpoint for each API, but may be too heavy for now!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that URL is not working I get:

U.S. Securities and Exchange Commission

Automated access to our sites must comply with SEC.gov's Privacy and Security Policy.

Please visit www.sec.gov/developer for more developer resources and Fair Access guidelines.

Please visit www.sec.gov/privacy for more information on Privacy Policy.

Reference ID: 0.8477d917.1739045494.29945d84

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may need to add headers since its the SEC

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

Successfully merging this pull request may close these issues.

2 participants