import pandas as pd
import httpx
= "https://www.sec.gov/files/company_tickers.json"
url = {"User-Agent": "Ben Thekkel (your_email@example.com)", "Accept": "application/json"}
headers
async with httpx.AsyncClient(http2=True, headers=headers, timeout=30.0) as client:
= await client.get(url)
r
r.raise_for_status()= r.json()
data
= pd.DataFrame.from_dict(data, orient="index")
df df
cik_str | ticker | title | |
---|---|---|---|
0 | 1045810 | NVDA | NVIDIA CORP |
1 | 789019 | MSFT | MICROSOFT CORP |
2 | 320193 | AAPL | Apple Inc. |
3 | 1652044 | GOOGL | Alphabet Inc. |
4 | 1018724 | AMZN | AMAZON COM INC |
... | ... | ... | ... |
10085 | 2053411 | PCPPF | PC Partner Group Ltd/ADR |
10086 | 2073638 | FINGF | Finning International Inc./ADR |
10087 | 2020414 | EDVGF | Endeavour Group Limited/ADR |
10088 | 2008315 | ARHUF | AAK AB/ADR |
10089 | 1788707 | ADYYF | Adyen N.V./ADR |
10090 rows × 3 columns