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

Can I get the Analyst rating data by this project? #12

Closed
jet-c-21 opened this issue Dec 9, 2023 · 2 comments
Closed

Can I get the Analyst rating data by this project? #12

jet-c-21 opened this issue Dec 9, 2023 · 2 comments

Comments

@jet-c-21
Copy link

jet-c-21 commented Dec 9, 2023

I want to select the symbol is in strong buy rating

@shner-elmo shner-elmo changed the title Can I get the Analyst rating data by this project? How to find a certain field? Dec 9, 2023
@jet-c-21
Copy link
Author

But I don't want the rating of "Technical Rating", I want to find the rating of "Analyst Rating", like the rating in the stock forecast page

@shner-elmo
Copy link
Owner

@jet-c-21 Sorry I misunderstood your initial question.
I did some digging and I found the fields you are looking for:

cols = [
    'recommendation_over',
    'recommendation_total',
    'recommendation_sell',
    'recommendation_under',
    'recommendation_hold',
    'recommendation_mark',
    'recommendation_buy',
]

_, df = Query().select( *cols).set_tickers('NASDAQ:AAPL').get_scanner_data()
df.to_dict('records')
[{'ticker': 'NASDAQ:AAPL',
  'recommendation_over': 5,
  'recommendation_total': 44,
  'recommendation_sell': 2,
  'recommendation_under': 1,
  'recommendation_hold': 14,
  'recommendation_mark': 1.5,
  'recommendation_buy': 22}]

image

And you can use the formatter from above for the recommendation_mark column. cheers

@shner-elmo shner-elmo changed the title How to find a certain field? Can I get the Analyst rating data by this project? Dec 11, 2023
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

No branches or pull requests

2 participants