Skip to main content

Official Python collector for API Graveyard — automatically tracks your outgoing HTTP dependencies

Project description

api-graveyard

Official Python collector for API Graveyard — automatically tracks your outgoing HTTP dependencies, detects risk events, and surfaces zombie APIs before they take down your product.

Install

pip install api-graveyard

Quick start

Add one call to the top of your app entry point:

import api_graveyard

api_graveyard.init(
    api_key="agk_your_key_here",
    project_id="your-project-id",
)

# ... rest of your app

That's it. Every outgoing HTTP/HTTPS request your app makes is now automatically captured, batched, and sent to API Graveyard in the background.

Works with

  • requests
  • httpx (sync mode)
  • urllib3 directly
  • Any library that uses urllib3 under the hood

Options

Option Type Default Description
api_key str required Your agk_... API key from the dashboard
project_id str required Your project ID from the dashboard
base_url str https://api-graveyard.com Override for self-hosted
service_name str None Tag events with a service name
environment str "production" Tag events with an environment
flush_interval_s float 10.0 How often to flush the event buffer (seconds)
max_batch_size int 100 Max events per batch before forcing a flush
debug bool False Log flush activity

Django / Flask example

# manage.py or wsgi.py / app factory
import api_graveyard

api_graveyard.init(
    api_key=os.environ["API_GRAVEYARD_KEY"],
    project_id=os.environ["API_GRAVEYARD_PROJECT_ID"],
    service_name="django-backend",
    environment=os.environ.get("DJANGO_ENV", "production"),
)

Graceful shutdown

The collector automatically flushes on process exit. For manual control:

import api_graveyard

api_graveyard.shutdown()

What gets captured

  • Method, URL, HTTP status code, response time
  • Timestamp of each request
  • Service name and environment (if configured)

Requests to api-graveyard.com itself are never captured to avoid infinite loops. Localhost and 127.0.0.1 requests are ignored by default.

Get your API key

  1. Sign up at api-graveyard.com
  2. Create a project
  3. Go to Settings → Integrations and create an API key

License

MIT

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

api_graveyard-0.1.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

api_graveyard-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file api_graveyard-0.1.1.tar.gz.

File metadata

  • Download URL: api_graveyard-0.1.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for api_graveyard-0.1.1.tar.gz
Algorithm Hash digest
SHA256 93126da54c7404461bde487ce450b78bc593007f725c229b977c10782f9ff3cd
MD5 5a009b3f96d0fdf67dfa000c4a50bd18
BLAKE2b-256 8433364e1e0a811e3d28f9eb653c39f4ecc8f0778ec9ae80fe62c9ad7305786f

See more details on using hashes here.

File details

Details for the file api_graveyard-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: api_graveyard-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for api_graveyard-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca46b6ac263b23fef569a49bb28ef67f50d0d64438442d563eedc6abaf9ec922
MD5 d66b1478d798b8fa26763bb73573f53f
BLAKE2b-256 3f281de5a854ab00a90c6b5ae164533175ff373bf291b5b5ef2e37ceae1e5c0d

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