HAR and Copy-as-fetch to API documentation formatter
Drop a HAR file or paste a fetch string, pick the calls, mask secret keys and copy a beautified request and response sequence for docs, bug reports or AI prompts.
- Period
- Jul 2024 – Sep 2025
- Technologies
- 3
- Diagrams
- 1
- Reading time
- 1 min
PythonDesktop GUI (Tk / Qt)JavaScript
Source & download: Turn HAR Files and "Copy as Fetch" into Clean API Documentation
Purpose (owner's words, portfolio page)
“API behaviour is scattered across the browser Network tab, and copying URLs, methods and minified JSON bodies one by one is slow and unreadable.” The tool is a centralised API clipboard: bulk-import .har files or paste “Copy as fetch” strings with raw responses, beautify JSON, remove or mask sensitive keys (wrap as [...]), deduplicate and re-order calls, and copy one structured request / response sequence for AI prompts, technical docs or bug reports.
Desktop script internals
Imports: tkinter (+ ttk), json, re, urllib.parse. Class-based app with setup_ui, setup_styles, add_request_response, parse_fetch_request (regex over fetch("url", {method, headers, body})), extract_body, list management (move_up, move_down, remove_selected, clear_all, refresh_results_list), generate_output (beautified, ordered sequence with stats) and copy_to_clipboard.
Diagram as text
flowchart LR IN[.har drop or Copy-as-fetch + response] --> P[parse: HAR entries / fetch regex] P --> L[request list: reorder, remove, dedupe] L --> M[mask / remove keys] M --> B[beautify JSON] B --> OUT[one structured text block + stats] --> CB[(clipboard)]
The web version adds drag-and-drop HAR import, key-filter options, stats and a responsive UI (single self-contained HTML / JS file).
Relationship
Part of the owner’s LLM-workflow tooling family together with ThuOneCopy (P22, code → prompt), the Markdown splitter (S05) and the directory lister (S04): tools that prepare context for AI assistants.
Related projects
copyCode prototypes: 15 versions towards ThuOneCopy
Fifteen PyQt5 prototype versions of a tool that copies selected project files as one block for ChatGPT, evolving into ThuOneCopy.
PythonDesktop GUI (Tk / Qt)PDF Agent: PDF split and shuffle tool (4 versions)
A small Tkinter desktop tool that splits PDFs several ways for visa-document preparation, refined through four versions in one week.
PythonPDF & document generationDesktop GUI (Tk / Qt)Redwings PDF Tools: desktop PDF compressor and toolkit
A desktop PDF compressor with a binary search for the sharpest result under a size limit.
PythonPDF & document generationDesktop GUI (Tk / Qt)SQLiteWant to discuss this project?
Happy to walk through the architecture, trade-offs or the code.