DankTools

API Documentation

REST API for proxy checking, geolocation and anonymity classification.

Base URL
GET /api/health

Returns the API status. Useful for monitoring and verifying the service is reachable.

Response

FieldTypeDescription
status string "ok" Always "ok" when the service is running.

Example

# Request
GET /api/health

# Response 200
{
  "status": "ok"
}
POST /api/check

Test a single proxy. Returns the proxy's working status, latency, exit-node geolocation, anonymity level, HTTPS support, and optional per-site reachability checks.

Request Body

FieldTypeDescription
proxy stringrequired string Proxy string — protocol://user:pass@host:port, host:port, or host:port:user:pass
protocol stringoptional "http" | "https" | "socks4" | "socks5" | "socks5h" Override the auto-detected protocol
timeout numberoptional 1–60 default: 10 Connection timeout in seconds
targets string[]optional string[] Site URLs to test reachability through this proxy (max 15)

Response Body

FieldTypeDescription
working boolean bool Whether the proxy successfully connected
input string string Original proxy string you sent
normalized string | null string Parsed & normalized proxy URL
protocol string | null string Detected protocol
host string | null string Proxy host
port integer | null int Proxy port
error string | null string Error message if the proxy failed
latency_ms number | null float Round-trip latency in milliseconds
https_supported boolean | null bool Whether the proxy supports HTTPS
anonymity string | null "elite" | "anonymous" | "transparent" Anonymity classification of the exit node
exit_ip string | null string Exit IP as seen by external services
country string | null string Country name
country_code string | null string ISO 3166-1 country code
region string | null string Region / state name
city string | null string City name
zip_code string | null string Postal code
lat number | null float Latitude
lon number | null float Longitude
timezone string | null string Timezone (IANA)
isp string | null string Internet Service Provider
org string | null string Organization name
asn string | null string Autonomous System Number
site_checks array | null SiteCheckResult[] Per-site reachability results (if targets provided)

SiteCheckResult

FieldTypeDescription
url string string Target URL that was tested
accessible boolean bool Whether the proxy could reach the site (status < 500)
status_code integer | null int HTTP status code from the target
latency_ms number | null float Latency to reach the target
error string | null string Error if the site was unreachable

Try It

POST /api/check-bulk

Test up to 200 proxies concurrently. Each proxy is tested with up to 25 parallel connections. Returns an array of ProxyResult objects, one per input proxy.

Request Body

FieldTypeDescription
proxies string[]required string[] List of proxy strings (1–200)
protocol stringoptional "http" | "https" | "socks4" | "socks5" | "socks5h" Override the auto-detected protocol for all proxies
timeout numberoptional 1–60 default: 10 Connection timeout in seconds
targets string[]optional string[] Site URLs to test reachability through each proxy (max 15)

Response Body

FieldTypeDescription
(array) ProxyResult[] ProxyResult[] Array of results, one per input proxy. Same schema as /api/check.

Example

# Request
POST /api/check-bulk
Content-Type: application/json

{
  "proxies": [
    "socks5://1.2.3.4:1080",
    "http://5.6.7.8:8080"
  ],
  "timeout": 10,
  "targets": ["https://www.google.com"]
}

# Response 200
[
  {
    "input": "socks5://1.2.3.4:1080",
    "working": true,
    "protocol": "socks5",
    "latency_ms": 234.5,
    "anonymity": "elite",
    "country": "Germany",
    "isp": "Deutsche Telekom",
    ...
  },
  ...
]

Try It

POST /api/scrape-test

Test if a website can be scraped using HTTPX, CloudScraper, or Playwright. Checks if specified CSS selectors return data through each method. Returns a scrape summary with element previews, media gallery, and a recommendation on which method to use.

Request Body

FieldTypeDescription
url stringrequired string Target URL to scrape
tags string[]required string[] CSS selectors or tag names to look for (1–20). E.g. ["img", "h1", "div.card", "a[href]", "meta[property=\"og:image\"]"]
timeout numberoptional 1–60 default: 15 Connection timeout in seconds
use_proxy string | nulloptional string Optional proxy for all methods, e.g. socks5://user:pass@host:port
methods string[]optional ["httpx", "cloudscraper", "playwright"] Which methods to test. Defaults to all three.

Response Body

FieldTypeDescription
url string string The tested URL
results ScrapeMethodResult[] array One result per tested method
recommendation string | null string Which method to use for scraping

ScrapeMethodResult

FieldTypeDescription
method string "httpx" | "cloudscraper" | "playwright" Which method was used
success boolean bool Whether the method successfully fetched the page
status_code integer | null int HTTP status code
latency_ms number | null float Round-trip latency in ms
error string | null string Error message if the method failed
html_length integer | null int HTML response size in bytes
page_title string | null string Contents of the <title> tag
tags_found object Dict[str, ScrapeTagResult[]] Map of selector → matched elements (max 30 per selector)
media_gallery MediaItem[] MediaItem[] Deduplicated images/videos found across all selectors
screenshot string | null string Base64-encoded PNG screenshot. For Playwright: live capture from headless Chromium. For httpx/cloudscraper: generated via thum.io external API.

ScrapeTagResult

FieldTypeDescription
tag string string Element tag name
text_preview string | null string Text content (up to 300 chars)
attrs object | null Dict[str, str] Key attributes: src, href, alt, class, data-src, srcset, etc.
media_url string | null string Resolved media URL (lazy-load attrs prioritized over src)
media_type string | null "image" | "video" Type of media element, if applicable

MediaItem

FieldTypeDescription
url string string Resolved absolute media URL
media_type string "image" | "video" Type of media
alt string | null string Alt text
width string | null string Width attribute
height string | null string Height attribute
source_selector string | null string Which selector found this media

Example

# Request
POST /api/scrape-test
Content-Type: application/json

{
  "url": "https://example.com",
  "tags": ["img", "h1", "meta[property=\"og:image\"]"],
  "methods": ["httpx", "cloudscraper", "playwright"]
}

# Response 200
{
  "url": "https://example.com",
  "results": [
    {
      "method": "httpx",
      "success": true,
      "status_code": 200,
      "latency_ms": 142.3,
      "page_title": "Example Domain",
      "media_gallery": [
        {
          "url": "https://example.com/image.jpg",
          "media_type": "image",
          "alt": "Photo",
          "source_selector": "img"
        }
      ],
      "tags_found": {
        "img": [
          {
            "tag": "img",
            "text_preview": null,
            "attrs": {
              "src": "https://example.com/image.jpg",
              "alt": "Photo"
            },
            "media_url": "https://example.com/image.jpg",
            "media_type": "image"
          }
        ]
      }
    }
  ],
  "recommendation": "Multiple methods work: httpx, cloudscraper, playwright. Playwright is most reliable for JS-heavy sites."
}

Try It