# cantdown.su — Full Documentation

> Ultra-fast, minimalist, and anonymous pastebin, file sharing service, and network debugging utility.

## Overview
cantdown.su provides instantaneous, anonymous text and file hosting with CLI support, syntax highlighting, and minimal overhead.

## Core Features
- Anonymous Pastebin: Save code and text snippets with auto-detected syntax highlighting.
- File Sharing: Upload files up to 100 MB with persistent storage.
- Network Utilities: Fast CLI endpoints for public IP (/ip), country code (/cc), request headers (/headers), TLS details (/tls), and geolocation metadata (/geo).
- Custom URLs: Support for custom slugs and secret edit keys for post-creation updates.
- Developer API: Simple cURL-friendly endpoints with plain text or JSON output.

## CLI Usage (cURL Examples)

### 1. Check Public IP
```bash
curl https://cantdown.su/ip
```

### 2. Check Country Code
```bash
curl https://cantdown.su/cc
```

### 3. Inspect HTTP Request Headers
```bash
curl https://cantdown.su/headers
```

### 4. Inspect TLS & Cipher
```bash
curl https://cantdown.su/tls
```

### 5. Check Geolocation & Network Metadata
```bash
curl https://cantdown.su/geo
```

### 6. Inspect Autonomous System Number (ASN)
```bash
curl https://cantdown.su/asn
```

### 7. Inspect User-Agent
```bash
curl https://cantdown.su/user-agent
```

### 8. Create a Text Paste
```bash
# Upload text directly
curl -d "Hello, World!" https://cantdown.su/paste

# Upload from file
curl --data-binary "@script.py" https://cantdown.su/paste

# Upload with custom URL slug
curl -H "X-Custom-Url: my-script" -d "print('hi')" https://cantdown.su/paste
```

### 9. Upload a File
```bash
curl -F "file=@photo.png" https://cantdown.su/upload
```

### 10. JSON Response Format
Add `Accept: application/json` header to any paste/upload request:
```bash
curl -H "Accept: application/json" -d "snippet" https://cantdown.su/paste
```
Response:
```json
{
  "success": true,
  "url": "https://cantdown.su/xyz123",
  "edit_url": "https://cantdown.su/edit/xyz123?key=...",
  "edit_key": "...",
  "id": "xyz123"
}
```

## HTTP Endpoints Reference

- GET /: Main web application
- POST /paste: Upload text paste (text/plain or application/x-www-form-urlencoded)
- POST /upload: Upload file (multipart/form-data)
- GET /:id: View paste or download file
- GET /edit/:id?key=...: Edit paste or file
- GET /ip: Echo client IP address
- GET /cc: Echo client two-letter country code
- GET /headers: Echo client HTTP headers in JSON
- GET /tls: Negotiated TLS cipher, version, and RTT in JSON
- GET /geo: Geolocation, ASN, city, region, coordinates in JSON
- GET /asn: Client ASN and ISP organization
- GET /user-agent (or /ua): Client User-Agent string
- GET /api: Plain text API documentation
- GET /llms.txt: AI agent discoverability file
- GET /llms-full.txt: Consolidated documentation for AI models
- GET /robots.txt: Crawler and AI bot access policies
- GET /sitemap.xml: XML sitemap
