We have real-time financial metrics for all actively-traded equities in the US.To get started, please create an account and grab your API key at financialdatasets.ai.You will use the API key to authenticate your API requests.
import requests# add your API key to the headersheaders = { "X-API-KEY": "your_api_key_here"}# set your query paramsticker = 'AAPL'# create the URLurl = ( f'https://api.financialdatasets.ai/financial-metrics/snapshot' f'?ticker={ticker}')# make API requestresponse = requests.get(url, headers=headers)# parse snapshot from the responsesnapshot = response.json().get('snapshot')