Skip to main content

Extract structured data from any website with one API call. Haunt API Python SDK.

Project description

hauntapi

Python SDK for Haunt API — extract structured data from any website with one API call.

Install

pip install hauntapi

Quick Start

from hauntapi import Haunt

client = Haunt(api_key="haunt_your_key")

# Extract data from any URL
result = client.extract(
    url="https://news.ycombinator.com",
    prompt="Get the top 5 story titles and their points"
)

print(result.data)
# {"stories": [{"title": "...", "points": 572}, ...]}

print(result.credits_remaining)
# 97

# Get usage info
print(client.usage())
# {"plan": "free", "remaining": 97, "monthly_limit": 100}

Features

  • extract(url, prompt) — Extract structured data from any URL
  • extract_auth(url, prompt, cookies=..., headers=...) — Extract from authenticated/private pages
  • extract_batch(urls, prompt) — Extract from multiple URLs at once
  • usage() — Check your quota and plan

Error Handling

from hauntapi import Haunt, AuthenticationError, QuotaExceededError

client = Haunt(api_key="your_key")

try:
    result = client.extract(url="https://example.com", prompt="Get the title")
except AuthenticationError:
    print("Invalid API key")
except QuotaExceededError:
    print("Monthly quota exceeded")

Pricing

  • Free: 100 requests/month, no credit card
  • Pro: $0.01/request — pay only for what you use

Get your API key at hauntapi.com.

Links

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

hauntapi-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

hauntapi-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for hauntapi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5a223b90c74604128b1d20e3380049f7ad356c606ab4ccc8c6092d5d1413519b
MD5 50f525577bda7c0702556097681ff174
BLAKE2b-256 bfb7ef3f0641d459d1f802fdd2659ba749d75fddc64435fd51195c81386ee252

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hauntapi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for hauntapi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66220a77c9d002c467b7a8222c1a557c09fd5a8bb0860bf80f19292a5f2745d3
MD5 18ae43501c03d9e05b1028d851f2b633
BLAKE2b-256 227f2227dff7a69e0262c9dcd2379088fefc96aec4be909d91c4e0f2c9841eb0

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