Menu

Read your AWS Cost Explorer CSV in 19 lines of Node
📰

Read your AWS Cost Explorer CSV in 19 lines of Node

DEV Community: cloud·Grain64·2 days ago
#2iZJmE2t
#devtocloud#devto#dev#total#file
Reading 0:00
15s threshold

Cost Explorer's charts answer "which service". The CSV answers the better question, "which line item, and when did it change". You can read it with a script short enough to paste into a terminal, and no AWS credentials are involved: you only read a file you already downloaded.

Get the file

In Cost Explorer, set the date range to the last 30 to 90 days, granularity Daily , Group by: Usage type , then Download CSV . The file has one row per usage type, one column per day, and a final column with the total.

Here is a tiny made-up file (synthetic, not from a real account), saved as sample.csv :

"Usage type" , "2026-10-01" , "2026-10-02" , "2026-10-03" , "Total costs($)" "USE1-BoxUsage:m5.large" , 36.86 , 36.86 , 36.86 , 110.58 "USE1-NatGateway-Bytes" , 8.00 , 8.00 , 31.00 , 47.00 "USE1-NatGateway-Hours" , 2.16 , 2.16 , 2.16 , 6.48 "USE1-DataTransfer-Regional-Bytes" , 12.00 , 12.00 , 12.00 , 36.00 "USE1-PublicIPv4:InUseAddress" , 0.48 , 0.48 , 0.48 , 1.44 "Total costs" , 59.50 , 59.50 , 82.50 , 201.50

Enter…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.