Not sure if my message was posted, sorry if this is a dupe. On Sunday, October 10, 2021 at 3:14:53 PM UTC+2 [email protected] wrote:
> The data comes in HTML but this looks like a pretty clean and > self-explanatory interface for Vanguard US: > https://personal.vanguard.com/us/funds/tools/pricehistorysearch > Unfortunately this doesn't work for some funds, like # 7741 which is "Vanguard Target Retirement 2040 Trust". > On Sat, 9 Oct 2021 at 17:55, Aaron Stacy <[email protected]> wrote: > >> And of course feel free to share if anyone has ideas for getting stuff >> like this from a proper API 🙂 >> >> On Sat, Oct 9, 2021 at 10:54 AM Aaron Stacy <[email protected]> wrote: >> >>> ...and I can answer my own question, but I'll post it here in case it >>> saves anyone else some time: >>> >>> The JSON API that now works came from inspecting this page >>> <https://institutional.vanguard.com/investments/product-details/fund/1470>, >>> and searching through the XHRs for the NAV price listed. This came up (no >>> headers seem to be needed): >>> >>> >>> https://eds.ecs.gisp.c1.vanguard.com/eds-eip-distributions-service/price/daily-nav-history/7743.json?start-date=2021-10-08&end-date=2021-10-09 >>> >>> Where "7743" is the FIID (fund ID? IDK), and while I don't remember >>> where I originally got 7743, I think it was in the malformed OFX export XML >>> from logging into my Vanguard portal. >>> >> This seems to work pretty good, but for some reason it has stopped responding from some IPs. It gives: curl -v 'https://eds.ecs.gisp.c1.vanguard.com/eds-eip-distributions-service/price/daily-nav-history/7741.json?start-date=2022-08-26&end-date=2022-08-28' < HTTP/1.1 302 Moved Temporarily < Transfer-Encoding: chunked < Connection: keep-alive < Date: Wed, 31 Aug 2022 12:42:57 GMT < Cache-Control: no-cache < Expires: 0 < Location: http://www.vanguard.com/notfound.htm < Pragma: no-cache < X-Cache: Miss from cloudfront < Via: 1.1 2a46367687c8f1815bbea20c92c7d64c.cloudfront.net (CloudFront) < X-Amz-Cf-Pop: AMS1-P2 < X-Amz-Cf-Id: i5Rwg5vzh336Pk4Zfc9G9l4sX85iKwa75HAvd0Wpr7iU1HhF1Uq1JA== < * Curl_http_done: called premature == 0 * Connection #0 to host eds.ecs.gisp.c1.vanguard.com left intact But when run from another machine, it works: < HTTP/1.1 200 OK < Content-Type: application/json < Content-Length: 152 < Connection: keep-alive < Cache-Control: private, no-cache, no-store, no-transform, must-revalidate, proxy-revalidate < Date: Wed, 31 Aug 2022 12:53:44 GMT < Expires: 0 < Pragma: no-cache < Server: < Set-Cookie: XSRF-TOKEN=4315B0A55DE9A185A2F7659040E10050; path=/; domain=.vanguard.com; secure < Strict-Transport-Security: max-age=31536000 ; includeSubDomains < X-Content-Type-Options: nosniff < X-Frame-Options: DENY < X-XSS-Protection: 1; mode=block < Vary: accept-encoding < X-Cache: Miss from cloudfront < Via: 1.1 2aa70b747c4cbd671958bc7faab603a2.cloudfront.net (CloudFront) < X-Amz-Cf-Pop: MSP50-C1 < X-Amz-Cf-Id: I2j-8JtZpZ_T-ZkOgC61e8PpqzpMBmxfum1eyCv5PiK3bRNrB63tyg== < * Connection #0 to host eds.ecs.gisp.c1.vanguard.com left intact [{"portId":"7741","accountingTypeCode":46,"priceItem":[{"price":110.33000000,"effectiveDate":"2022-08-26","priceTypeCode":"NAV","currencyCode":"USD"}]}] Anyone happen to know why that might happen? Thanks. > >>> On Sat, Oct 9, 2021 at 10:53 AM Aaron Stacy <[email protected]> wrote: >>> >>>> I've got a script that fetches prices for Vanguard frunds from one of >>>> the APIs I found their website was making XHR's to. It looks something >>>> like >>>> (tho I also needed the "Referer: https://vanguard.com" header: >>>> >>>> >>>> https://api.vanguard.com/rs/cfv/global/eip-distributions-service-webservice-production-current/rs/price/daily-nav-history/0928.json?start-date=2021-09-30&end-date=2021-10-01 >>>> >>>> This has worked for most of a year, up til last month, not only for >>>> ETFs, but also Vanguard funds like their target retirement funds, and even >>>> the target retirement trust fund my company uses for the 401k, but now I'm >>>> getting 404s. >>>> >>>> I've found this will give me JSON of today's price (but not historical): >>>> >>>> >>>> https://invproductsui.vanguard.com/content/site-services/market-data/0928 >>>> >>>> And this will give me HTML of historical prices, but not for the Target >>>> Retirement 2050 Trust fund my company uses for their 401k: >>>> >>>> >>>> https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=ExchangeTradedShares&FundIntExt=INT&FundId=0928&fundName=0928&radiobutton2=1&beginDate=01/01/2020&endDate=01/02/2020&year= >>>> >>>> Does anyone know of APIs to fetch NAV prices for these funds by date? >>>> >>> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "Ledger" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ledger-cli/CACjABk%3DYC29kxrLsM4n3qm%3DP-oZ0RSZxBEsrWLN4tEvGycpQkg%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/ledger-cli/CACjABk%3DYC29kxrLsM4n3qm%3DP-oZ0RSZxBEsrWLN4tEvGycpQkg%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/7faa9f5e-047c-4d62-bcd8-1bf8a187d931n%40googlegroups.com.
