Skip to main content

Official Python SDK for the Snapshot Site API

Project description

Snapshot Site Python SDK

PyPI Python License CI

Official Python SDK for the Snapshot Site API.

Install

pip install snapshot-site-sdk

Create your API token in Snapshot Site Console:

Usage

from snapshot_site import SnapshotSiteClient

client = SnapshotSiteClient(api_key="ss_live_xxx")

result = client.screenshot({
    "url": "https://snapshot-site.com",
    "format": "png",
    "fullSize": True,
})

print(result.get("link"))

Screenshot example

from snapshot_site import SnapshotSiteClient

client = SnapshotSiteClient(api_key="ss_live_xxx")

result = client.screenshot({
    "url": "https://snapshot-site.com/pricing",
    "width": 1440,
    "format": "png",
    "fullSize": True,
    "hideCookie": True,
})

print(result)

Analyze example

from snapshot_site import SnapshotSiteClient

client = SnapshotSiteClient(api_key="ss_live_xxx")

result = client.analyze({
    "url": "https://snapshot-site.com",
    "width": 1440,
    "fullSize": True,
    "enableSummary": True,
    "enableQuality": True,
})

print(result)

Compare example

from snapshot_site import SnapshotSiteClient

client = SnapshotSiteClient(api_key="ss_live_xxx")

result = client.compare({
    "before": {
        "url": "https://snapshot-site.com/pricing",
        "width": 1440,
        "fullSize": True,
        "hideCookie": True,
    },
    "after": {
        "url": "https://staging.snapshot-site.com/pricing",
        "width": 1440,
        "fullSize": True,
        "hideCookie": True,
    },
    "threshold": 0.1,
})

print(result)

Download assets locally

from snapshot_site import SnapshotSiteClient

client = SnapshotSiteClient(api_key="ss_live_xxx")

result = client.screenshot({
    "url": "https://snapshot-site.com/pricing",
    "format": "png",
    "fullSize": True,
})

client.download_to(result, "pricing.png")

Custom base URL

client = SnapshotSiteClient(
    api_key="ss_live_xxx",
    base_url="https://api.prod.ss.snapshot-site.com",
)

Tests

python -m pip install -e .[dev]
pytest

Build for PyPI

python -m pip install -e .[dev]
python -m build

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

snapshot_site_sdk-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

snapshot_site_sdk-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for snapshot_site_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a95b5c7de8099c89b062dff031bd7163211ad772cd034eeea07a7545a6e9a138
MD5 f9366a2986eacde00a8f34159f3a801e
BLAKE2b-256 7b2caac6ab76d06f261aa28ae90d4e29968d93cb1d4ff597a434f349a597cc39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snapshot_site_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2f6cbcf75fe1b3378c58c9983141cfa749025ee49eacc8e7859cb38dd219d02
MD5 a90a29e6f28bcbdd6dfb4aede108b6ec
BLAKE2b-256 b9410a2a160fc6993b185d00ce92365f55ef480f569f93218fa97f48bf8369c7

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