question

asrinand avatar image
1 Like"
asrinand asked ·

Screening Financial Data by Securities with Financial Year filter

G'day,

I see that the financial data when you are screening by securities gives you the data for the last quarter.
Is it possible to screen by data for a specific quarter with following additions (in BOLD) to the code?


from __future__ import print_function
import time
import intrinio_sdk
from intrinio_sdk.rest import ApiException
from pprint import pprint
 
intrinio_sdk.ApiClient().configuration.api_key['api_key'] = 'YOUR_API_KEY'
 
security_api = intrinio_sdk.SecurityApi()
 
 
clause1 = intrinio_sdk.SecurityScreenClause(field ='totalcommonequity', operator = 'gt', value = 100000000)
 
logic = intrinio_sdk.SecurityScreenGroup(operator ="OR", clauses =[clause1])
order_direction = 'desc' 
primary_only = True 
page_size = 100 

try:
  api_response = security_api.screen_securities(logic=logic, order_direction=order_direction, primary_only=primary_only, page_size=page_size,fiscal_year = 2017, fiscal_period = 'FY') #is this possible
  pprint(api_response)
except ApiException as e:
  print("Exception when calling SecurityApi->screen_securities: %s\r\n" % e)


python
10 |600 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

· Write an Answer
mkelly avatar image
0 Likes"
mkelly answered ·

Yes and no. The parameters for security_api.screen_securities are restricted to the five optimal parameters (logic, order_column, order_diretion, primary_only, and page_size) with their associated types. To screen the data by fiscal year, you would need to create another clause for your logic parameter:

clause1 = intrinio_sdk.SecurityScreenClause(field ='totalcommonequity', operator = 'gt', value = 100000000)
clause2 = intrinio_sdk.SecurityScreenClause(field = 'next_earnings_year', operator = 'eq', value = 2017)

logic = intrinio_sdk.SecurityScreenGroup(operator ="OR", clauses =[clause1, clause2])


To help with field tags, https://data.intrinio.com/data-tags is a simple way to search the tag library. I hope that helps!

· Share
10 |600 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.