Skip to content

Darko893/hauntapi-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages