# 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.

URL: https://thuyavan.netlify.app/projects/har-api-docs-formatter
Updated: 2026-10-12

- Period: 2024-07 → 2025-09
- Technologies: Python, Desktop GUI (Tk / Qt), JavaScript

## 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.

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.
