Is there a way to download TSP share prices in a CSV file format

General TSP Discussion.

Moderator: Aitrus

Post Reply
MrSnrub
Posts: 104
Joined: Sun Jun 26, 2016 8:21 am

Is there a way to download TSP share prices in a CSV file format

Post by MrSnrub »

Before the Great TSP Redesign From Hell, I would use the following URL to download the share prices in a CSV (comma-separated value) file format:

https://secure.tsp.gov/components/CORS/ ... download=1

Does anybody know of a way to replicate this? Or if the official TSP site plans on re-inserting this functionality in the future?
Nobody knows what the market is going to do in the future. Stop asking. Just shut up and follow strategy #72033 to glory.

nilber
Posts: 1
Joined: Sat Jun 04, 2022 3:20 pm

Re: Is there a way to download TSP share prices in a CSV file format

Post by nilber »

I've been trying to sort it out but haven't been entirely successful. I've extracted the following from the source code that does technically return CSV formatted data.

https://secure.tsp.gov/data/getSharePri ... oad_1.html

What I haven't been able to accomplish is passing the specific dates and funds I want to "download". I use a script in an Access database to pull updated share prices since the last time I ran the script.

The portion "getSharePrices_startdate_20220424_enddate_20220524_Lfunds_1_InvFunds_1_download_1" is not a parameter string being passed back to the server. Instead it is hard coded into the JavaScript and appears to me that it is all still a work in progress, although several TSP sites have either cracked the code or have someone manually transcribing the share prices.

MrSnrub
Posts: 104
Joined: Sun Jun 26, 2016 8:21 am

Re: Is there a way to download TSP share prices in a CSV file format

Post by MrSnrub »

That actually should work great for now! I just need to adjust my script a little, but that shouldn't be a problem. Thank you!
Nobody knows what the market is going to do in the future. Stop asking. Just shut up and follow strategy #72033 to glory.

User avatar
mjedlin66
Site Admin
Posts: 1513
Joined: Wed Oct 02, 2013 7:51 pm

Re: Is there a way to download TSP share prices in a CSV file format

Post by mjedlin66 »

I applaud you guys for sharing the info with each other that I had to figure out the hard way.
Owner/creator of TSPcalc.com - "Know your numbers"

User avatar
Aitrus
Moderator
Posts: 2318
Joined: Mon Aug 06, 2012 5:03 pm

Re: Is there a way to download TSP share prices in a CSV file format

Post by Aitrus »

mjedlin66 wrote: Mon Jun 06, 2022 4:38 am I applaud you guys for sharing the info with each other that I had to figure out the hard way.
That's always been one of my favorite things about this place: how the community members help each other understand the system better.
Seasonal Musings 2022: viewtopic.php?f=14&t=19005
Recommended Reading: http://tspcenter.com/forums/viewtopic.php?f=14&t=13474
"It's not what happens to you, but how you react to it that matters" Epictetus

MrSnrub
Posts: 104
Joined: Sun Jun 26, 2016 8:21 am

Re: Is there a way to download TSP share prices in a CSV file format

Post by MrSnrub »

Arrgh! Broken again! Or at least not updated with 6/27/2022 data like the main Share Prices page is.

https://www.tsp.gov/data/getSharePrices ... oad_1.html
Nobody knows what the market is going to do in the future. Stop asking. Just shut up and follow strategy #72033 to glory.

User avatar
mjedlin66
Site Admin
Posts: 1513
Joined: Wed Oct 02, 2013 7:51 pm

Re: Is there a way to download TSP share prices in a CSV file format

Post by mjedlin66 »

MrSnrub wrote: Tue Jun 28, 2022 6:35 am Arrgh! Broken again! Or at least not updated with 6/27/2022 data like the main Share Prices page is.

https://www.tsp.gov/data/getSharePrices ... oad_1.html
Change ".html" to ".csv" and you'll be off to the races again.
Owner/creator of TSPcalc.com - "Know your numbers"

MrSnrub
Posts: 104
Joined: Sun Jun 26, 2016 8:21 am

Re: Is there a way to download TSP share prices in a CSV file format

Post by MrSnrub »

Works great (for now), thanks a bunch!

And as a warning, the HTML file linked above now gives incorrect data. It just puts in yesterday's data for June 24th. DO NOT USE IT.
Nobody knows what the market is going to do in the future. Stop asking. Just shut up and follow strategy #72033 to glory.

User avatar
12squared
Posts: 516
Joined: Thu Dec 31, 2015 7:28 am

Re: Is there a way to download TSP share prices in a CSV file format

Post by 12squared »

The new site now has a Download share prices button. It appears to function the same as the old site.
“The genius of investing is recognizing the direction of the trend — not catching the highs or the lows.”
- Dean Witter

"You'll have to adapt or you'll be out of style."
- Robert Smith

MrSnrub
Posts: 104
Joined: Sun Jun 26, 2016 8:21 am

Re: Is there a way to download TSP share prices in a CSV file format

Post by MrSnrub »

Arrgh! It's down again. So I don't know what Friday's closing prices were.

Well, I know that the S Fund's price is $61.4532, because if I login to my account and go to the "Investments" section, that's what it says the S Fund's closing price is. Can y'all that are in other funds please log in to your accounts and go to the "Investments" section and tell me what the closing price is for other TSP funds?
Nobody knows what the market is going to do in the future. Stop asking. Just shut up and follow strategy #72033 to glory.

Post Reply

Fund Prices2022-11-25

FundPriceDayYTD
G $17.17 0.02% 2.59%
F $18.31 0.13% -12.35%
C $61.66 -0.03% -14.29%
S $65.01 0.27% -22.09%
I $34.21 0.59% -13.27%
L2065 $12.68 0.23% -14.82%
L2060 $12.68 0.23% -14.81%
L2055 $12.68 0.23% -14.80%
L2050 $26.21 0.20% -12.70%
L2045 $12.06 0.19% -11.82%
L2040 $44.40 0.18% -10.84%
L2035 $11.84 0.17% -9.77%
L2030 $39.82 0.15% -8.62%
L2025 $11.55 0.11% -5.68%
Linc $22.97 0.08% -2.17%

Live Charts

Pending Allocations

Under development. For now, you may view Pending Allocations by going to "fantasy TSP" and selecting "Leaderboard sort" of "Pending Allocations".