The lightweight SDKs are downloadable, reusable server-side HTTP clients, not just request snippets. They handle authentication, timeouts, idempotent retries, bounded waiting and pagination, while preserving the results returned by the service. They do not contain DNS pollution assessment implementation.
Download the lightweight SDKs
Initial release 0.1.0 · Public contract verified 2026-10-12. Reading and downloading do not require sign-in. Running checks requires a valid account and balance.
Download verification: SHA-256
PHP
692b9900ffdcc1c860c6456b5a3a27c892528885254649c388aeffb08f3dca36
Python
17745cdaf21b98d86c4331945ac99c0941dfb0a62fdd1c951925524985a90ace
Node.js
6b4fa4481957c6136ed8a90a235a89ce45c2a033e8d59ecfe0b5e9516928b004
PHP, Python and Node.js use built-in facilities or standard extensions, without additional third-party client packages. This release is distributed through the versioned ZIP files above, not Composer, PyPI or npm. Do not install an unverified third-party package with a similar name.
Before running an example
- Obtain the unified API key in Console and set the server-side
WEAVEBIT_API_KEYenvironment variable. Never put a real key in web pages, repositories, download bundles or logs. - Read the included English or Chinese README and check the runtime and extensions. Examples estimate by default; the API v1 scenario only prints a request plan by default. A deliberate execution option is required to run a paid check.
- Before creating an API v2 batch, persist the request and a caller-generated idempotency key. PHP and Node.js examples use
WEAVEBIT_IDEMPOTENCY_KEYand a request file; the Python example first saves both into a state file. If creation is uncertain, retry the same request and key instead of submitting a new key.
python3 example.py --help
php example.php --help
node example.mjs --help
Run each command inside its corresponding downloaded bundle. The SDKs are server-side tools: do not run the Node.js example as browser JavaScript. Review the estimate before creating a batch; the example defaults do not replace your budget approval process.
Choose an integration scenario
| Your goal | Suggested API | Preparation |
|---|---|---|
| Low-volume, immediate single-domain DNS pollution checks | Synchronous API v1 method | One domain per request. There is no idempotent retry contract; the SDK does not retry automatically. |
| Batch DNS pollution checks as a first investigation step | API v2, dns_pollution_check | Submit a domain list without user-selected nodes; estimate before creation. |
| Convenient, comprehensive batch checks of China domain access | API v2, gfw_full_domain_check | Choose actual nodes relevant to customer regions and carriers. Covers DNS pollution, HTTP Host and TLS SNI, not full browser or business transaction testing. |
Client methods cover all six API v2 endpoints: nodes, estimates, creation, batch lists, results and balance. Other public check types can be submitted through the generic estimate and create methods. See the API documentation for parameters; the SDK does not reproduce detection assessment logic.
What the clients handle
- Separate transport, HTTP, JSON and application errors; preserve server results and monetary decimal strings.
- A default request timeout of 30 seconds and at most four attempts. Retries respect
Retry-Afterand never generate a new key for the same logical creation. - A default total waiting limit of 300 seconds, including requests, retries and polling intervals. A client timeout does not cancel the batch or create another one; resume queries using the original
batch_id. - Recognize the documented
pending,runningandcompletedbatch states; unknown states raise an explicit error. Completion means execution has ended, not that every target is normal. - Collect all target result pages instead of treating the first page as complete. An inconclusive
nullremains unchanged.
Python's standard library uses socket timeouts and checks the total deadline before and after requests. This is not an operating-system hard cancellation and does not promise strict real-time termination for a connection that continuously trickles data. Add a process-level execution limit if a hard deadline is required. When a server-requested retry delay exceeds the configured waiting cap, the SDK stops retrying rather than sending an early request.
The client waiting limit differs from the service execution deadline. Batches execute for at most six hours and are cleaned up 24 hours after creation. Save required results promptly; recovery of uncertain creation also remains subject to the 24-hour idempotency record window.
Verification and usage permission
This release was checked against the public API contract and tested offline with simulated responses. It does not claim verification through real paid detection runs. Bundled tests cover timeout, error, retry, idempotency, pagination and waiting boundaries. Before large-scale use, test a small authorized target set in your own integration and review the actual charges.
You may copy and modify the bundled client code to integrate with WeaveBit APIs. This does not grant rights to server implementations, trademarks or third-party dependencies. Service access and billing remain subject to existing service terms. See the bundled permission notice, version notes and method signatures.
Continue reading
Existing cURL and multilingual quick examples · Batch API workflow · Pricing and budgeting guide · Result semantics · Free DNS Pollution Check