This block matches the installed SDK surface. It needs a real token and consumes live service resources, so run it only after reviewing the current account and billing settings.
import os
from nstdata_ai_crawl import NstDataClient, ScrapeRequestDto, Format
token = os.environ["NSTDATA_API_TOKEN"]with NstDataClient(token)as client: result = client.submit_scrape_task_sync( ScrapeRequestDto( url="https://example.com/", formats=[Format.MARKDOWN], onlyMainContent=True,))print(result)
Validate body-level success, content, and expected page markers before storing output. An HTTP response alone does not prove that the requested content was retrieved.
Example 2: Use an Nstdata Proxy in Python
Nstdata Proxy does not require the Crawl SDK. Use the generated channel endpoint with a standard client:
ModuleNotFoundError: confirm the virtual environment and import name.
Missing token: verify NSTDATA_API_TOKEN in the current process.
Accepted task without content: inspect task status and body-level errors.
Proxy authentication failure: regenerate the endpoint and URL-encode credential components.
Timeouts: use bounded retries with jitter and do not retry permanent denials.
Conclusion
Use the Crawl SDK for crawl tasks, a standard HTTP client for Proxy, and a Router URL for Proxy Manager. Keeping those boundaries explicit makes the integration easier to test and troubleshoot.
Experience Nstdata β Start Your Free Trial Today