Created
September 1, 2020 12:43
-
-
Save malterb/92a481a184ec6afc56f7189bb4d97ff3 to your computer and use it in GitHub Desktop.
Export Amplitude data per day
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this script will loop through every day between the two dates and download the amplitude data to a zip file named after the day | |
# the script will actually duplicate the 00 data, but running unzip -o will take care of it by overwriting | |
d=2018-01-01 | |
while [ "$d" != 2020-09-02 ]; do | |
formatted=$(date -d $d "+%Y%m%d") | |
echo "getting ${formatted}" | |
d=$(date -I -d "$d + 1 day") | |
formatted_new=$(date -d $d "+%Y%m%d") | |
curl -u API_Key:Secret_Key "https://amplitude.com/api/2/export?start=${formatted}T00&end=${formatted_new}T00" >> ${formatted}.zip | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment