Skip to main content

CoreClaw Python SDK client.

Project description

CoreClaw Python SDK

CoreClaw Python SDK for running scraper scripts and reading run results.

Install

pip install coreclaw-client

Run a Scraper

from coreclaw import CoreClawClient

client = CoreClawClient(api_key="YOUR_API_KEY")

run = client.scraper("SCRAPER_SLUG").run(
    input={
        "parameters": {
            "system": {
                "proxy_region": "US",
                "cpus": 0.125,
                "memory": 512,
                "execute_limit_time_seconds": 1800,
                "max_total_charge": 0,
                "max_total_traffic": 0,
            },
            "custom": {
                "keyword": "python",
            },
        }
    },
)

print(run["run_slug"])
client.close()

To run a specific version:

run = client.scraper("SCRAPER_SLUG").run(
    input={...},
    version="v1.0.1",
)

If version is not provided, CoreClaw uses the latest available version.

Get Run Results

from coreclaw import CoreClawClient

client = CoreClawClient(api_key="YOUR_API_KEY")

results = client.run("RUN_SLUG").list_results(limit=10, offset=0)

print(results["count"])
for item in results["list"]:
    print(item)

client.close()

Async Usage

Run a scraper:

from coreclaw import CoreClawAsyncClient

client = CoreClawAsyncClient(api_key="YOUR_API_KEY")
run = await client.scraper("SCRAPER_SLUG").run(input={...})
await client.close()

Get run results:

from coreclaw import CoreClawAsyncClient

client = CoreClawAsyncClient(api_key="YOUR_API_KEY")
results = await client.run("RUN_SLUG").list_results(limit=10, offset=0)
await client.close()

More

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

coreclaw_client-1.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

coreclaw_client-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file coreclaw_client-1.0.0.tar.gz.

File metadata

  • Download URL: coreclaw_client-1.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for coreclaw_client-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9943803994413b5c4d960f195aa34758693482a929db86023a17232f0978ed7a
MD5 6120377f6dba2d96f12579d4024b75c7
BLAKE2b-256 359f2b0854130c42f40447a9992f1dd914063c38a17f40b59009115461aa8a5f

See more details on using hashes here.

File details

Details for the file coreclaw_client-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for coreclaw_client-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5619dd1fd1a405a2137159c00fd577deddc507aa58bf0929b03fcbc4d128b23f
MD5 c766b1d112c4c3840e32184032e20f85
BLAKE2b-256 7c312f4df66f4458ac046e866b98ba190d0d0b79293ed7876885d6cd27921c3a

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