Zip to Text Extractor
This API is a specialized tool for developers and AI engineers. It downloads a remote ZIP file, recursively extracts every file inside, and compiles them into a single, structured .txt file.
This can be useful for feeding an entire project codebase into Large Language Models (LLMs) like ChatGPT, Claude, DeepSeekz etc. for analysis without manually copying and pasting files.
Endpoint
Section titled “Endpoint” POST
/api/v1/unzip Request Parameters
Section titled “Request Parameters”The following parameters are accepted in the request body:
| Field | Type | Required | Description |
|---|---|---|---|
url | string | Yes | Direct URL to the .zip file (e.g., a GitHub repository archive link). |
includeBinary | boolean | Optional | If true, images/PDFs are converted to Base64. If false, they are skipped to save space. (Default: false). |
Request Examples
Section titled “Request Examples”Choose your preferred method to interact with the Unzip API:
curl -X POST https://heavstal.com.ng/api/v1/unzip \-H "Content-Type: application/json" \-H "x-api-key: <YOUR_API_KEY>" \-d '{"url": "https://github.com/HeavstalTech/api/archive/refs/heads/main.zip", "includeBinary": false}'const response = await fetch('https://heavstal.com.ng/api/v1/unzip', { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': '<YOUR_API_KEY>' }, body: JSON.stringify({ url: 'https://github.com/HeavstalTech/api/archive/refs/heads/main.zip', includeBinary: false })});
const res = await response.json();console.log(res.data);import { tools } from '@heavstal/api';import fs from 'fs';
// includeBinary: false skips images/PDFs, perfect for text/code extractionconst codebase = await tools.unzip("https://github.com/HeavstalTech/api/archive/refs/heads/main.zip", { includeBinary: false});
// The SDK automatically handles the file buffer for youfs.writeFileSync(codebase.filename, codebase.buffer);import requests
url = "https://heavstal.com.ng/api/v1/unzip"headers = { "Content-Type": "application/json", "x-api-key": "<YOUR_API_KEY>"}payload = { "url": "https://github.com/HeavstalTech/api/archive/refs/heads/main.zip", "includeBinary": False}
response = requests.post(url, headers=headers, json=payload)print(response.json()["data"])Response Examples
Section titled “Response Examples”{ "status": "success", "creator": "HEAVSTAL TECH", "data": { "source": "https://github.com/...", "result_file": "https://files.catbox.moe/codebase.txt", "format": "txt", "binary_included": false }}{ "status": "error", "error": "Failed to extract ZIP. The file may be corrupt or exceed the size limit."}