Skip to main content

Python SDK for nstdata

Project description

nstdata crawl SDK (Python)

中文版

Python SDK for nstdata crawl, an advanced web scraping and crawling service.

Installation

pip install nstdata-ai-crawl

Features

  • Basic Scraping: Get HTML and Markdown synchronously.
  • Screenshots & PDFs: Take full-page screenshots and export pages as PDFs.
  • Browser Actions: Orchestrate browser actions like wait for elements, fill forms, click buttons, scroll, and execute JS.
  • Custom Configuration: Bring your own cookies, headers, and simulate mobile devices.
  • Content Filtering: Automatically extract high-quality main content, filter out ads and navigational elements.
  • Proxy Support: Specify proxy type (residential or datacenter) and exit country.
  • Asynchronous Execution & Polling: Submit time-consuming tasks and poll for results.
  • Batch Crawling: Traverse entire sites with depth and page limits.

Quick Start

See main.py for a complete list of usage examples.

import os
from nstdata_ai_crawl import NstDataClient, ScrapeRequestDto, Format

# Initialize the client with your API token
TOKEN = os.getenv("NSTDATA_API_TOKEN", "YOUR_API_TOKEN")

def main():
    with NstDataClient(TOKEN) as client:
        # Submit a basic scraping task
        res = client.submit_scrape_task_sync(ScrapeRequestDto(
            url="https://example.com/",
            formats=[Format.MARKDOWN],
            timeout=60000,
        ))
        
        # Output the resulting markdown
        print(res.data.get_markdown())

if __name__ == "__main__":
    main()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nstdata_ai_crawl-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nstdata_ai_crawl-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file nstdata_ai_crawl-0.1.0.tar.gz.

File metadata

  • Download URL: nstdata_ai_crawl-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for nstdata_ai_crawl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9133f9599f54a2a309ee569f64ba61a170dd36300aeebedfbccc09dec227fb12
MD5 1f1b68453d1553f7baeefda6c6c3f9e8
BLAKE2b-256 f6771771ccfe16882bcbda09401b3a046826e5dee8b6d6f6a8b4908d05a323c7

See more details on using hashes here.

File details

Details for the file nstdata_ai_crawl-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nstdata_ai_crawl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2702287953c8283ea0bee3649479224d66157a88244ee58aebf85b096d675af9
MD5 b648f5783065203ed1739c22d3f88858
BLAKE2b-256 4515159f0b9f2455084bfd4e8e7e270842e9208feddeae26f8f64e552a81490e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page