Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Python and Javascript Api data to website

31d71eb1072408f5eaf3179dbc47f0aa26486551c6cf172bb787e0bf6bd230dd

Search bar.

The user will search a company like Apple or Netflix. The user will not be able to
input a date or which filing. Only the company name or ticker. Ticker for Apple would
be AAPL and for Netflix, NFLX. The user will be shown the different kind of metrics
as demonstrated below of the last 5 years if no other specification is made.

Keys metrics required for “extracting necessary data”

Please view XBRL to Json Converter on the API Documentation

With the code below you can see all the keys that are possible. Of course some keys
metrics are less important than others. This does not mean that some key metrics are
not needed. With the example below the search is performed with Accession_no but this
can also be htm_url
(https://www.sec.gov/Archives/edgar/data/320193/000032019320000096/aapl-20200926.htm)

The values associated with each key metrics is required to be extracted from the API.

from sec_api import XbrlApi

xbrlApi =
XbrlApi("31d71eb1072408f5eaf3179dbc47f0aa26486551c6cf172bb787e0bf6bd230dd")
accession_no="0001564590-21-004599"
xbrl_json = xbrlApi.xbrl_to_json(accession_no=accession_no)

print("Key metrics of the XBRL-JSON dictionary of Apple's 10-K filing")


print('---------------------------------')
print(*list(xbrl_json.keys()), sep='\n')

print("Key metrics of income statement in XBRL")


print('---------------------------------')
print(*list(xbrl_json["StatementsOfIncome"].keys()), sep='\n')

print("Key metrics of the Balance sheets ")


print('---------------------------------')
print(*list(xbrl_json["BalanceSheets"].keys()), sep='\n')
Also take into account that for example running the code:
print(*list(xbrl_json.keys()), sep='\n') for Apple or Netflix will result in
different Key metrics!. We will need to find a solution to this. All metrics other
than the Income statement, balance sheet and cash flow will be shown on the “other
financial metrics tab.

Income statement, balance sheet and cash flow will be the same for all companies and
both 10k and 10Q reports. Income statement will be shown on the Income statement tab,
Balance Sheet will be on the Balance sheet tab. Cash flow will be on the Cash Flow
tab.

Extractor API. Please view Extractor API on the API documentation. (This will be in
under the tab Corporate Disclosures.)

It is only required to show the most recent 10k and 10Q report when a search in the
search bar is performed!

Extracted information required for 10k reports:

The necessary data is all Section items except item 6 on the 10k report.

Extracted information required for 10Q reports:

All items.

8-K report is not needed and can be dismissed.

CIK, CUSIP, Ticker Mapping API. (please view CIK, CUSIP, Ticker Mapping API on the
API documentation)

Search bar.

The user will search a company like Apple or Netflix. The user will not be able to
input a date or which filing. Only the company name or ticker. Ticker for Apple would
be AAPL and for Netflix, NFLX.

Information required to be displayed when a search is performed.

This information can be placed under the tab Company overview

 name (string) - the name of the company, e.g. Tesla Inc


 ticker (string) - the ticker symbol of the company.
 cik (string) - the CIK of the company. Trailing zeros are removed.
 exchange (string) - the main exchange the company is listed on, e.g. NASDAQ
 category (string) - the security category, e.g. "Domestic Common Stock"
 sector (string) - the sector of the company, e.g. "Consumer Cyclical"
 industry (string) - the industry of the company, e.g. "Auto Manufacturers"
 sicSector (string) - SIC sector name of the company, e.g. "Manufacturing"
 sicIndustry (string) - SIC industry name of the company, e.g. "Motor Vehicles & Passenger
Car Bodies"
 currency (string) - operating currency of the company, e.g. "USD"
 location (string) - location of the company's headquarters

When isDelisted is set to true do not show the company in search!

Insider trading API (Please view Insider Trading API) This will be under the insider
trading tab

Extract insider trading. Only requirement is the PeriodOfReport, Name,


acquiredDisposed, Shares, Shareprice and total.

Float API (please view Float (Outstanding shares API) This will be under the Float
tab

Extract Oustanding shares And Public float.

Subsidiary (please view Subsidiary API on the API documentation.)This will be on the
Subsidiary tab.

Extract Subsidiary information and display it like this:


The frontpage will become something that includes this:

You might also like