Output Formats¶
Introduction¶
AtDork provides flexible output options to suit different workflows and integration needs. Whether you need a quick terminal view, a structured JSON file for programmatic processing, or a CSV for spreadsheet analysis, AtDork has you covered.
Results can be exported in multiple formats, stored in a SQLite database for history and deduplication, and saved either as a single file or per-query files.
What It Does¶
| Feature | Description |
|---|---|
| Terminal Output | Beautiful formatted display with colors and snippets |
| JSON Export | Structured format for programmatic processing |
| CSV Export | Spreadsheet-friendly format for analysis |
| TXT Export | Human-readable plain text format |
| SQLite Database | Local database for history, resume, and deduplication |
| Database Export | Export entire database to JSON or CSV |
| Deduplication | Automatically remove duplicate URLs |
| Snippet Control | Show or hide result snippets |
How to Use¶
Terminal Output (Default)¶
Output:
[1] Government Report 2024
URL: https://example.gov/report.pdf
Cuplikan: This report contains...
──────────────────────────────────────────────────
[2] Budget Document 2024
URL: https://example.gov/budget.pdf
Cuplikan: The budget for 2024...
──────────────────────────────────────────────────
Total: 10 results
Hide Snippets in Terminal¶
Save to JSON¶
Save to CSV¶
Save to TXT¶
Batch with Separate Output Files¶
Batch with Single Output File¶
Disable Deduplication (Keep All Results)¶
View Search History¶
Export Database to JSON¶
Export Database to CSV¶
How It Works¶
1. Output Processing Flow¶
1. User provides query and output options
↓
2. AtDork executes search
↓
3. Results are validated and filtered
↓
4. Deduplication (if enabled):
├─ Check database for existing URLs
└─ Remove duplicate results
↓
5. Results are stored in SQLite database
↓
6. Output is generated:
├─ Terminal: display results
├─ File: save in requested format
└─ Database: store for history/resume
2. Output Formats¶
| Format | File Extension | Structure | Best For |
|---|---|---|---|
| TXT | .txt |
Human-readable with headers | Quick manual review |
| JSON | .json |
Structured key-value pairs | Programmatic processing |
| CSV | .csv |
Tabular format | Spreadsheet analysis |
3. File Structure Examples¶
JSON Output:
[
{
"title": "Government Report 2024",
"href": "https://example.gov/report.pdf",
"body": "This report contains detailed information..."
},
{
"title": "Budget Document 2024",
"href": "https://example.gov/budget.pdf",
"body": "The budget for 2024 includes..."
}
]
CSV Output:
title,href,body
"Government Report 2024","https://example.gov/report.pdf","This report contains detailed information..."
"Budget Document 2024","https://example.gov/budget.pdf","The budget for 2024 includes..."
TXT Output:
Dork Scanner Results
Query: site:gov filetype:pdf
Timestamp: 2026-06-25 14:30:00
Total: 2 results
[1] TITLE: Government Report 2024
URL: https://example.gov/report.pdf
SNIPPET: This report contains detailed information...
--------------------------------------------------------------------------------
[2] TITLE: Budget Document 2024
URL: https://example.gov/budget.pdf
SNIPPET: The budget for 2024 includes...
--------------------------------------------------------------------------------
4. Database Schema¶
Queries Table:
CREATE TABLE IF NOT EXISTS queries (
id INTEGER PRIMARY KEY AUTOINCREMENT,
query_text TEXT UNIQUE NOT NULL,
status TEXT NOT NULL DEFAULT 'pending',
created_at TEXT NOT NULL,
updated_at TEXT NOT NULL
);
Results Table:
CREATE TABLE IF NOT EXISTS results (
id INTEGER PRIMARY KEY AUTOINCREMENT,
query_id INTEGER NOT NULL,
title TEXT,
href TEXT,
body TEXT,
raw_json TEXT,
created_at TEXT NOT NULL,
FOREIGN KEY (query_id) REFERENCES queries(id),
UNIQUE(query_id, href)
);
5. Deduplication Logic¶
1. For each result, extract URL (href)
↓
2. Check database for existing href
↓
3. If href exists → skip this result
↓
4. If href is new → insert into database
↓
5. Only new results are included in output
Disable Deduplication:
6. Database Export¶
Export to JSON:
Export to CSV:
Database Export Structure:
{
"1": [
{"title": "...", "href": "...", "body": "..."},
{"title": "...", "href": "...", "body": "..."}
],
"2": [
{"title": "...", "href": "...", "body": "..."}
]
}
7. Per-Query Output Files¶
When using --output-dir, each query gets its own file:
results/
├── site_gov_filetype_pdf.json
├── site_edu_filetype_xls.json
├── inurl_admin_login.json
└── intitle_index_of_backup.json
File Naming:
- Special characters are replaced with underscores
- Filename is truncated to 50 characters
- Extension matches --format (default: .txt)
Full Flag Reference¶
| Flag | Description | Default |
|---|---|---|
-o, --output |
Save all results to single file | None |
--output-dir |
Save each query to separate file | None |
--format |
Output format: txt, json, csv |
txt |
--no-snippet |
Hide snippets in terminal | Disabled |
--verbose, -v |
Show results in batch mode | Disabled |
--no-dedup |
Disable URL deduplication | Disabled |
--export-db |
Export database to file (json/csv) | None |
--history |
Show search history | Disabled |
--db-path |
SQLite database path | atdork.db |
Real-World Use Cases¶
1. Generate JSON Report for Processing¶
2. Create CSV for Spreadsheet Analysis¶
3. Batch with Separate Files for Each Query¶
4. View History and Export Database¶
5. Quick Terminal View with Snippets¶
6. Export Database for Weekly Reporting¶
Troubleshooting¶
| Problem | Solution |
|---|---|
| File not saved | Check --output path has write permissions |
| JSON parsing errors | Ensure output is valid JSON (use jq to validate) |
| CSV columns misaligned | Check field names in --format csv |
| Too many duplicate results | Use --no-dedup to keep all results |
| Database locked | Close other AtDork instances, delete atdork.db |
| History empty | Ensure --db-path points to correct database |
| Export database fails | Check path has write permissions |
Output Structure Examples¶
Terminal Output (Default)¶
Hasil untuk: site:gov filetype:pdf
1. Government Report 2024
URL: https://example.gov/report.pdf
Cuplikan: This report contains detailed information...
──────────────────────────────────────────────────
2. Budget Document 2024
URL: https://example.gov/budget.pdf
Cuplikan: The budget for 2024 includes...
──────────────────────────────────────────────────
Total: 10 results
JSON Output¶
[
{
"title": "Government Report 2024",
"href": "https://example.gov/report.pdf",
"body": "This report contains detailed information..."
}
]
CSV Output¶
title,href,body
"Government Report 2024","https://example.gov/report.pdf","This report contains detailed information..."
TXT Output¶
Dork Scanner Results
Query: site:gov filetype:pdf
Timestamp: 2026-06-25 14:30:00
Total: 2 results
[1] TITLE: Government Report 2024
URL: https://example.gov/report.pdf
SNIPPET: This report contains detailed information...
--------------------------------------------------------------------------------