This script runs in your browser and allows you to save your watch history from Amazon Prime Video to a JSON or CSV file, where it can be processed further or imported into other platforms.
- โก Browser-based: Run the script directly in your browser, no installation required
- ๐ฅ Detailed export: Save your complete watch history as a JSON or CSV file with the following columns:
- Date Watched (date and time)
- Type (movie or TV show)
- Title
- Episode Title (for TV shows)
- Global Title Identifier (GTI)
- Episode Global Title Identifier (GTI)
- Path (URL)
- Episode Path (URL)
- Image URL
- ๐ Multi-language support1: Built-in support for every language supported by Amazon Prime
- โ๏ธ Flexible configuration: Power users can easily modify values used by the script to suit their needs, like:
- mode (interactive or headless)
- output format (JSON or CSV)
- output filename
- date format (human-readable or Unix Timestamp)
- delimiters
- column names
1 Column names will still be in English, but you can easily edit the values in the script or resulting file if you wish.
"Date Watched","Type","Title","Episode Title","Global Title Identifier","Episode Global Title Identifier","Path","Episode Path","Image URL"
"2025-09-28 02:00:24.173","Series","The Terminal List: Dark Wolf - Season 1","Episode 1: ""INHERENT RESOLVE""","amzn1.dv.gti.83c8ce44-b42e-40fd-8546-c36fd2824071","amzn1.dv.gti.16c010ce-0da6-42fb-b031-13dfa43105b6","/region/na/detail/0MYH9XYR9SCGXB57LR8ES71GFL/ref=atv_set_wh_dp","/region/na/detail/0GI3HHV1BYZKGSIE8EEPCUPUPI/ref=atv_set_wh_dp","https://images-na.ssl-images-amazon.com/images/S/pv-target-images/4b6e6de10b8cda8efd7b42419c2cf4c82649a44dc7a03528f28f7cd9280d4b46._UX667_UY375_SY200_.jpg"
"2023-10-03 04:06:31.437","Movie","Everything Everywhere All at Once","","amzn1.dv.gti.9d433401-4b4f-4737-9ec7-ce92e6b313f2","","/region/na/detail/0OGS49QMOKJSEBRYHCDSWSP8MQ/ref=atv_set_wh_dp","","https://m.media-amazon.com/images/S/pv-target-images/bba149329b86df530aaa47625125cafd766fc14fde4867e2d067afea0f4faadd._UX667_UY375_SY200_.jpg"[
{
"dateWatched": 1759024824173,
"type": "Series",
"title": "The Terminal List: Dark Wolf - Season 1",
"episodeTitle": "Episode 1: \"INHERENT RESOLVE\"",
"id": "amzn1.dv.gti.83c8ce44-b42e-40fd-8546-c36fd2824071",
"episodeId": "amzn1.dv.gti.16c010ce-0da6-42fb-b031-13dfa43105b6",
"path": "/region/na/detail/0MYH9XYR9SCGXB57LR8ES71GFL/ref=atv_set_wh_dp",
"episodePath": "/region/na/detail/0GI3HHV1BYZKGSIE8EEPCUPUPI/ref=atv_set_wh_dp",
"imageUrl": "https://images-na.ssl-images-amazon.com/images/S/pv-target-images/4b6e6de10b8cda8efd7b42419c2cf4c82649a44dc7a03528f28f7cd9280d4b46._UX667_UY375_SY200_.jpg"
},
{
"dateWatched": 1696305991437,
"type": "Movie",
"title": "Everything Everywhere All at Once",
"episodeTitle": "",
"id": "amzn1.dv.gti.9d433401-4b4f-4737-9ec7-ce92e6b313f2",
"episodeId": "",
"path": "/region/na/detail/0OGS49QMOKJSEBRYHCDSWSP8MQ/ref=atv_set_wh_dp",
"episodePath": "",
"imageUrl": "https://images-na.ssl-images-amazon.com/images/S/pv-target-images/bba149329b86df530aaa47625125cafd766fc14fde4867e2d067afea0f4faadd._UX667_UY375_SY200_.jpg"
}
]Pasting the script into your your browser's console lets it interact with the page and extract watch history like so:
- The first chunk of watch history data is delivered with the page as a JSON string embedded in a
<script type="text/template">tag. The script finds and extracts this data and parses it into a JavaScript object - The rest of the watch history is loaded with API calls when you scroll down the page. To get this data, we
monkey-patch the built-in
fetchto listen for responses containing the desired data - To actually make the API calls, we simulate scrolling to the bottom of the page
- Once all data is loaded, we construct a CSV file and trigger a download using a data URL
Previous versions of this script parsed the DOM directly, but the data available in the DOM is not as complete and adding support for multiple languages requires writing a lot of extra code for handling locale-specific dates and other strings.
Caution
For security reasons, I do not recommend running scripts from the internet unless you understand what they are doing. If you are not a developer, I recommend reading the comments in the code and/or asking a LLM like ChatGPT to explain it to you.
Warning
Don't scroll down the page before you run the script. Scrolling will cause new items to be loaded before the script is able to see them, meaning there will be missing movies/shows in the output. I recommend reloading the page and then running the script.
Instructions:
- Open primevideo.com/settings/watch-history in your browser
- Open your browser's devtools console (how?)
- Copy the code in watch-history-exporter-for-amazon-prime-video.js and paste it into the console. If this doesn't work or you see a warning message about pasting, see the FAQ.
- Press enter to run the script. You should see the script running in the console and you'll be prompted to save a file when it finishes. If this doesn't happen, see the FAQ.
| Column | Description |
|---|---|
| Date Watched | When the item was watched. Stored as a timestamp or formatted date, depending on configuration. |
| Type | Whether the item is a movie or a series episode. |
| Title | The movie title or series name. |
| Episode Title | The episode title (empty for movies). |
| Global Title Identifier | Amazonโs internal unique identifier for the movie or series. |
| Episode Global Title Identifier | Amazonโs internal unique identifier for the episode (empty for movies). |
| Path | Prime Video URL path for the movie or series. To get the full URL, prepend https://www.primevideo.com to this value. |
| Episode Path | Prime Video URL path for the episode (empty for movies). To get the full URL, prepend https://www.primevideo.com to this value. |
| Image URL | URL of the poster or thumbnail image. |
There are several constants at the top of the script that can be used to tweak the script's behavior to suit your needs.
By default, the script will prompt you when something goes awry so you can decide if you want to continue or not.
If you want to run the script programmatically or you don't care about warnings, you can change the OPTION.interactive
variable at the top of the script from true to false to automatically continue when warnings are displayed.
Note
CSV files have human-readable column names, while JSON files have machine-readable property names.
By default, the output is saved as a CSV file. If you prefer JSON, change the OPTION.outputJson variable at the top of
the script from false to true.
JSON uses tabs to indent the output by default, but you can change this to an empty string for a smaller file size or spaces if you prefer those.
Note
The file extension will be added automatically.
By default, the output filename is watch-history-export-<timestamp>. You can change this by modifying the
OPTION.outputFilename variable at the top of the script.
By default, dates and times are saved in an RFC 3339-like format like yyyy-mm-dd hh:mm:ss.sss. Dates in this format
are human-readable and easily understood by most spreadsheet programs.
If you plan on using the CSV data programmatically, you can instead output raw Unix Timestamps like 1759024824173.
Note that this is in milliseconds.
To do this, change the OPTION.formatDates variable at the top of the script from true to false.
Note
The default values were chosen because they are compatible and auto-detected by most spreadsheet programs. They have also been tested to make sure things like weird movie titles don't break the output. Changing delimiters has the potential to cause issues.
The DELIMITERS constant at the top of the file contains various delimiters used in the CSV file. By default, we use
" to separate strings, , to separate columns, and \n (newline) to separate rows. \t (tab) is used to separate
JSON objects when exporting as JSON. If you want to use different delimiters, you can customize the values here.
The MSG constant at the top of the file contains column names and values. If you want the CSV to be in a different
language, you can customize these values.
Alternatively, you can use a text editor or spreadsheet program to rename the columns after the CSV is generated.
Need help? See the support resources for information on how to:
- request features
- report bugs
- ask questions
- report security vulnerabilities
Some solutions to common issues are also listed below.
Nothing shows up when I paste in the console / I get a warning when I try to paste in the console
Some browsers prevent you from pasting code in the console because it could be malicious. This is called Paste Protection and you can read more about it on the Chrome for Developers Blog.
If this happens, follow the instructions in the console to re-enable pasting, and then try again. For Chrome, the following steps should work:
- Try to paste something in the console. You should get a warning message about pasting
- Type "allow pasting" in the console and press enter
See this video for a visual walkthrough.
I get an Uncaught SyntaxError: Unexpected identifier error when running the script
Make sure that you select the entire file with Ctrl + A when copying it. If part of the script is cut off, it won't work.
The script runs, but I am not prompted to save a file
If you have a default download folder set, check if the file is there.
Otherwise, make sure "Pop-ups and redirects" and "Automatic downloads" are enabled for <www.primevideo.com> in your browser settings.
Something else is broken
If you can't get things working, you can try running an older version of the script. v2.1.0 uses a different method to export your watch history than the current version, so it may work if the current version doesn't.
Want to help out? Pull requests are welcome for:
- feature implementations
- bug fixes
- translations
- documentation
- tests
See the contribution guide for more details.
Copyright ยฉ 2026 John Goodliff (@twocaretcat).
This project is released into the public domain (attribution is appreciated but not required ๐). See the license for details.
Find this project useful? Sponsoring me will help me cover costs and commit more time to open-source.
If you can't donate but still want to contribute, don't worry. There are many other ways to help out, like:
- ๐ข reporting (submitting feature requests & bug reports)
- ๐จโ๐ป coding (implementing features & fixing bugs)
- ๐ writing (documenting & translating)
- ๐ฌ spreading the word
- โญ starring the project
I appreciate the support!
