- SECTIONS
FactSet ETF API provides complete and accurate reference data across the universe of exchange-traded products. Data is sourced from ETF providers across the globe and includes more than 100 unique data points, resulting in comprehensive coverage to help you evaluate and construct ETFs, analyze potential trades, and perform fund research.
FactSet Reference data uses FactSet's FCS, which categorizes exchange-traded products using a rules-based system that is derived from seven core classifications. This system evaluates the asset class, economic development level, and geographical region as described in each fund's prospectus and marketing materials. ETF exposure details are presented on successively granular levels- category, then focus, and then niche.
Moreover, FactSet ETF Reference data captures over 100 unique data points and provides market-specific data if you wish to solely focus on U.S., Canadian, Australian, New Zealand, Singapore, Hong Kong or European exchanges. All data points are grouped in one of two levels, either as a Fund or as a Listing. A subset of reference data items are provided for European-domiciled funds.
# Content API - FactSet ETF - references end point code snippet
# This notebook demonstrates basic features of the FactSet ETF API by walking through the following steps:
# 1. Import Python packages
# 2. Enter your Username and API Key for authorization
# 3. For each ETF endpoint, create request objects and display the results in a dataframe
# 1. Import the required packages
import requests
import json
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
from pandas.io.json import json_normalize
# 2. Create a connection object
# Enter your credentials for 'Username' and 'API Key' variables below.
# To generate an API key, visit (https://developer.factset.com/authentication) for more details on Authentication.
authorization = ('USERNAME-SERIAL','API-KEY')
# 3.1 ETF Reference
# Retrieve ETF Reference data including name and launch date. Visit the developer portal for more information regarding the ETF API. It is required you are authorized to receive the data requested.
# 3.1a `/factset-etf/v1/reference` - Create a request object and set the parameters
reference_endpoint = 'https://api.factset.com/content/factset-etf/v1/reference'
reference_request = {
"ids": [
"EQAL-US"
],
"metrics": [
"factsetEntityId"
],
"categories": [
"BENCHMARK_DETAILS"
]
}
headers = {'Accept': 'application/json','Content-Type': 'application/json'}
# 3.1b `/factset-etf/v1/reference` - Pull data, display datafame properties, show initial records
reference_post = json.dumps(reference_request)
reference_response = requests.post(url = reference_endpoint, data=reference_post, auth = authorization, headers = headers, verify= False )
print('HTTP Status: {}'.format(reference_response.status_code))
#create a dataframe from POST request, show dataframe properties
reference_data = json.loads(reference_response.text)
reference_df = json_normalize(reference_data['data'])
print('COLUMNS:')
print('')
print(reference_df.dtypes)
print('')
print('RECORDS:',len(reference_df))
# #### Display the Records
print(reference_df[['benchmarkFamilyId','benchmarkDistTreatment','segBenchmarkCurrency','fsymId','rebalancingFrequencyCode','benchmarkName','benchmarkId','segBenchmarkId','segBenchmarkDistTreatment','factsetEntityId','benchmarkTransparentFlag','segBenchmarkDistTreatmentCode','benchmarkCurrency','requestId','benchmarkWebsite','benchmarkDistTreatmentCode','benchmarkFamily','userContrTransparentFlag']].tail())