Last active
October 4, 2024 15:04
-
-
Save RichardoC/28daefd23c1ac303803972c012f15d93 to your computer and use it in GitHub Desktop.
Download all claude conversations for an organisation
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
# Steps for finding the cookies in Firefox | |
# Open the network tab from hamburger menu -> more tools -> Web Development tools | |
# Refresh a claude webpage | |
# Right click on a request to the claude.ai domain | |
# click "Copy Request headers" | |
# Put the value of Cookie: in this value | |
export COOKIE="" | |
export ORG_ID="" # find by going to <https://claude.ai/projects>, clicking on a project and getting the id from the path e.g. <https://claude.ai/project/RELEVANT_BIT> | |
export OUTPUT_FILE="/tmp/convos.json" | |
curl "https://api.claude.ai/api/organizations/$ORG_ID/chat_conversations" --compressed -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0' -H 'Accept: */*' -H 'Accept-Language: en-GB,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Referer: https://claude.ai/' -H 'anthropic-client-sha: unknown' -H 'anthropic-client-version: unknown' -H 'Content-Type: application/json' -H 'Origin: https://claude.ai' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Connection: keep-alive' -H "Cookie: $COOKIE" -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'Priority: u=4' -H 'TE: trailers' | jq -r '.[] | .uuid' | xargs -I {} curl "https://api.claude.ai/api/organizations/$ORG_ID/chat_conversations/{}" --compressed -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0' -H 'Accept: */*' -H 'Accept-Language: en-GB,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'Referer: https://claude.ai/' -H 'anthropic-client-sha: unknown' -H 'anthropic-client-version: unknown' -H 'Content-Type: application/json' -H 'Origin: https://claude.ai' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Connection: keep-alive' -H "Cookie: $COOKIE" -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-site' -H 'Priority: u=4' -H 'TE: trailers' > "${OUTPUT_FILE}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment