Investing in Mutual Funds.
Mutual funds became really popular these days and they show great opportunities for both beginners and more experienced investors.
As we understand all investments carry certain risks, but mutual funds are usually considered a more reliable investment than purchasing individual stocks,
as they consist of many company stocks within one investment and offer more diversification than owning one or a few individual stocks.
But there are circumstances as fees that should be also considered by market participants.
As a simplified way to get the idea, a mutual fund is a company that takes money from many investors and invests them in securities such as stocks, bonds, and short-term debt.
Mutual funds are different from ETFs as funds' orders are executed once per day, all investors have the same price and ETFs trade like stocks which means price changes throughout the day.
Python Knowledge Base: Make coding great again.
- Updated:
2024-12-20 by Andrey BRATUS, Senior Data Analyst.
How to get Mutual Funds data ?
Python code to get a list of mutual funds available:
List of mutual funds output (shown partly):
Python code to get a list of mutual funds types:
List of mutual funds types (shown partly):
Python code to get a complete information on a mutual fund:
Complete information on a mutual fund (shown partly):
In our case we will use Python to access free online Mutual Funds APIs from rapidapi.com, you need to get "your-api-key".
Free API key will allow certain amount of requests per day and per month, in case of wider commercial use you can chose sutable paid subscription.
Original data is taken from Twelve Data which provides all necessary information for developers to enter the world markets.
Output data is in JSON format which can be easily converted to any suitable form for further visualisation and analysis,
Mutual Funds data will give you a new way to gain stable profitable market profits.
This API request returns a list of mutual funds available at Twelve Data. Sorting is in descending order by total assets value. The list is updated daily.
import requests
url = "https://twelve-data1.p.rapidapi.com/mutual_funds/list"
querystring = {"apikey":"demo"}
headers = {
"X-RapidAPI-Key": "your-api-key",
"X-RapidAPI-Host": "twelve-data1.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
{"result":{"count":222668,"list":[{"symbol":"JETG","name":"JPMorgan European Growth \u0026amp; Income plc","country":"United Kingdom","fund_family":"","fund_type":"","performance_rating":0,"risk_rating":0,"currency":"GBp"},{"symbol":"AEMC","name":"Aberdeen Emerging Markets Investment Company Limited","country":"United Kingdom","fund_family":"","fund_type":"","performance_rating":0,"risk_rating":0,"currency":"GBp"},{"symbol":"IIP","name":"Infrastructure India Plc","country":"United Kingdom","fund_family":"","fund_type":"","performance_rating":0,"risk_rating":0,"currency":"GBp"},{"symbol":"INV","name":"Investment Company plc","country":"United Kingdom","fund_family":"","fund_type":"","performance_rating":0,"risk_rating":0,"currency":"GBp"}...
This API request returns a list of mutual funds types.
import requests
url = "https://twelve-data1.p.rapidapi.com/mutual_funds/type"
headers = {
"X-RapidAPI-Key": "your-api-key",
"X-RapidAPI-Host": "twelve-data1.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers)
print(response.text)
{"result":{"Austria":["2035+ Target Date Portfolio","Alt - Event Driven","Alt - Long/Short Equity - Other","Asia ex Japan Equity","Asia-Pacific inc. Japan Equity"],"Brazil":["Europe Large-Cap Growth Equity","Other Allocation","Other Bond","Sector Equity Other"],"Canada":["2025 Target Date Portfolio","2030 Target Date Portfolio","2035 Target Date Portfolio","2035+ Target Date Portfolio","Alt - Long/Short Equity - Europe"],"Chile":["Other Allocation"],"China":["Aggressive Allocation Fund","Alt - Event Driven","Alt - Long/Short Equity - Other","Alt - Market Neutral - Equity","Asia Allocation"],"Denmark":["Alt - Currency","Alt - Debt Arbitrage","Alt - Long/Short Equity - Other","Alt - Multistrategy","Alt - Other"]...
This API request returns a complete breakdown of a mutual fund, including summary, performance, risk, ratings, composition, purchase_info, and sustainability.
import requests
url = "https://twelve-data1.p.rapidapi.com/mutual_funds/world"
querystring = {"symbol":"VFIAX"}
headers = {
"X-RapidAPI-Key": "your-api-key",
"X-RapidAPI-Host": "twelve-data1.p.rapidapi.com"
}
response = requests.request("GET", url, headers=headers, params=querystring)
print(response.text)
{"mutual_fund":{"summary":{"symbol":"VFIAX","name":"Vanguard 500 Index Fund","fund_family":"Vanguard","fund_type":"Large Blend","currency":"USD","share_class_inception_date":"2000-11-13","ytd_return":-0.17121,"expense_ratio_net":0,"yield":0,"nav":360.26999,"min_investment":0,"turnover_rate":0,"net_assets":686500216832,"overview":"The fund employs an indexing investment approach designed to track the performance of the Standard \u0026 Poor's 500 Index, a widely recognized benchmark of U.S. stock market performance that is dominated by the stocks of large U.S. companies. The advisor attempts to replicate the target index by investing all, or substantially all, of its assets in the stocks that make up the index, holding each stock in approximately the same proportion as its weighting in the index.","people":[{"name":"Michelle M. Louie","tenure_since":"2017-11-30"}]},"performance":{"trailing_returns":[{"period":"ytd","share_class_return":-0.17121...