Warning

The YCharts API is available to our API customers for their internal use only. Any redistribution or commercial use of data from the API is strictly prohibited without prior written consent from YCharts. For more details on our API’s capabilities and pricing please contact sales@ycharts.com or call (866) 965-7552.

Mutual Fund Data Series

The Mutual Fund Data Series Endpoint is used to obtain a series of date-value pairs of data from one or more companies for one or more calculations. It takes optional start_date and end_date parameters and will return all values between the requested dates. It also accepts a number of optional parameters for series resampling and aggregation.

Note

Full list of calcs can be found in the API Reference Guide

Request Info

Request Method

GET

URL

https://api.ycharts.com/v3/mutual_funds/symbol[s]/points/calc[s]?start_date=start_date&end_date=end_date&resample_frequency=resample_frequency&resample_function=resample_function&fill_method=fill_method&aggregate_function=aggregate_function&use_estimates=use_estimates&force_date_range=force_date_range

Request Parameters

Parameter

Required

Description

symbol[s]

Y

The exchange symbol for a mutual fund, or a comma separated list of exchange symbols

calc[s]

Y

The code for a calculation, or a comma separated list of calculations

start_date

N

The first date of the desired data range, defaults to one day ago

end_date

N

The last date of the desired data range, defaults to today

resample_frequency

N

This value specfies the desired resampling frequency of each series in the response.

resample_function

N

The operation used to resample data.

fill_method

N

This value specifies the mechanism by which null values in the response are handled.

aggregate_function

N

The operation used to return a single-value statistic per calc series in the response.

use_estimates

N

Uses estimate data for the provided calcs when available. (true or false)

force_date_range

N

A resampling parameter that pegs series response data to the supplied date range. (true or false)

Note

  • There is a maximum of 100 companies per request.

  • There is a maximum of 100 calculations per request.

  • resample_frequency and resample_function must be specified together.

  • See our for a complete list of parameter value options.

Tip

The code for a calculation can be found in the url of the mutual fund’s historical data page. For example, the price of M:FCNTX is found at https://ycharts.com/mutual_funds/M:FCNTX/price.

Response Info

The response will contain one or more mutual fund objects. The key for each mutual fund object is the exchange symbol passed in the request.

Mutual Fund Object Fields

Field

Type

Description

meta

Meta

This object contains information about the query for the mutual fund object

results

Results

This object contains one or more calculation data objects. The key for each object is the code for the calculation.

Calculation Data Object Fields

Field

Type

Description

data

Array

An array of arrays, each containing a date-value pair

meta

Meta

This object contains information about the query for the data

Examples

The following is an example successful request with relative dates

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price?start_date=-60&end_date=-50

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price?start_date=-60&end_date=-50"
    },
    "response": {
        "M:FCNTX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "price": {
                    "data": [
                        ["2014-07-21", 99.43],
                        ["2014-07-22", 100.04],
                        ["2014-07-23", 100.56],
                        ["2014-07-24", 100.7],
                        ["2014-07-25", 100.0],
                        ["2014-07-28", 99.97],
                        ["2014-07-29", 99.62]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        },
        "meta": {
            "status": "ok"
        }
    }
}

The following is an example successful request with multiple calculations and absolute dates

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price,dividend_yield?start_date=2014-08-02&end_date=2014-08-12

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price,dividend_yield?start_date=2014-08-02&end_date=2014-08-12"
    },
    "response": {
        "M:FCNTX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "dividend_yield": {
                    "data": [
                        ["2014-08-04", 0.0778],
                        ["2014-08-05", 0.0785],
                        ["2014-08-06", 0.0784],
                        ["2014-08-07", 0.0788],
                        ["2014-08-08", 0.0781],
                        ["2014-08-11", 0.0778],
                        ["2014-08-12", 0.078]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                },
                "price": {
                    "data": [
                        ["2014-08-04", 98.74],
                        ["2014-08-05", 97.92],
                        ["2014-08-06", 98.07],
                        ["2014-08-07", 97.55],
                        ["2014-08-08", 98.42],
                        ["2014-08-11", 98.8],
                        ["2014-08-12", 98.58]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        },
        "meta": {
            "status": "ok"
        }
    }
}

The following is an example successful request with multiple mutual funds

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/price?start_date=-60&end_date=-50

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/price?start_date=-60&end_date=-50"
    },
    "response": {
        "M:FCNTX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "price": {
                    "data": [
                        ["2014-07-21", 99.43],
                        ["2014-07-22", 100.04],
                        ["2014-07-23", 100.56],
                        ["2014-07-24", 100.7],
                        ["2014-07-25", 100.0],
                        ["2014-07-28", 99.97],
                        ["2014-07-29", 99.62]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        },
        "M:VFIAX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "price": {
                    "data": [
                        ["2014-07-21", 182.24],
                        ["2014-07-22", 183.16],
                        ["2014-07-23", 183.48],
                        ["2014-07-24", 183.57],
                        ["2014-07-25", 182.69],
                        ["2014-07-28", 182.74],
                        ["2014-07-29", 181.92]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        },
        "meta": {
            "status": "ok"
        }
    }
}

The following is an example of an incorrect request with invalid relative dates

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/price?start_date=-60&end_date=-dsd

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/price?start_date=-60&end_date=-dsd"
    },
    "response": {
        "meta": {
            "error_code": 400,
            "error_message": "Invalid end date format.",
            "status": "error"
        }
    }
}

The following is an example of an incorrect request, which contains an error in the calculation

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/bad_calc?start_date=-60&end_date=-50

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX,M:VFIAX/series/bad_calc?start_date=-60&end_date=-50"
    },
    "response": {
        "M:FCNTX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "bad_calc": {
                    "meta": {
                        "error_code": 404,
                        "error_message": "Calc Not Found.",
                        "status": "error"
                    }
                }
            }
        },
        "M:VFIAX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "bad_calc": {
                    "meta": {
                        "error_code": 404,
                        "error_message": "Calc Not Found.",
                        "status": "error"
                    }
                }
            }
        },
        "meta": {
            "status": "ok"
        }
    }
}

The following is an example successful request with resampling parameters

Request URL

https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price?start_date=2014-01-01&end_date=2014-03-01&resample_frequency=monthly&resample_function=min

Response

{
    "meta": {
        "status": "ok",
        "url": "https://api.ycharts.com/v3/mutual_funds/M:FCNTX/series/price?start_date=2014-01-01&end_date=2014-03-01&resample_frequency=monthly&resample_function=min"
    },
    "response": {
        "M:FCNTX": {
            "meta": {
                "status": "ok"
            },
            "results": {
                "price": {
                    "data": [
                        ["2014-01-31", 113.91],
                        ["2014-02-28", 112.52],
                        ["2014-03-31", 110.38]
                    ],
                    "meta": {
                        "status": "ok"
                    }
                }
            }
        }
    }
}