Skip to content

Commit

Permalink
Merge pull request #3 from goldmermaid/main
Browse files Browse the repository at this point in the history
add demo example
  • Loading branch information
goldmermaid authored Jun 11, 2024
2 parents 185fcf5 + 99f8b13 commit 4840e9b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions test/aisec_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import sys

sys.path.append(".")
sys.path.append("..")
sys.path.append("../..")

from pprint import pprint

import sec_agent_sdk
from sec_agent_sdk import ApiClient, DefaultApi, FilingTable, FormType
from sec_agent_sdk.rest import ApiException

configuration = sec_agent_sdk.Configuration()

# Configure API key authorization: APIKeyHeader
configuration.api_key["APIKeyHeader"] = "YOUR-API-KEY"

# Enter a context with an instance of the API client
with ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = DefaultApi(api_client)
form_type = FormType.TEN_Q # FormType | 10-K | 10-Q | 8-K | 6-K
company = "AMZN" # ticker
# date_filed = '2024-04-17' # str | date string in YYYY-mm-dd
table = (
FilingTable.BUSINESS_SEGMENTS_AND_KPIS
) # FilingTable | 'cash-flow-statement' | 'income-statement' | 'balance-sheet'

try:
# Search sec filing
api_response = api_instance.search_sec_filing(form_type, company, table)
print("The response of DefaultApi->search_sec_filing:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->search_sec_filing: %s\n" % e)

0 comments on commit 4840e9b

Please sign in to comment.