Skip to main content

Simple API monitoring & analytics for REST APIs built with FastAPI, Flask, Django, Starlette, Litestar and BlackSheep.

Project description

Apitally logo

API monitoring & analytics made simple

Metrics, logs, traces, and alerts for your APIs — with just a few lines of code.


Apitally dashboard


Apitally SDK for Python

Tests Codecov PyPI

Apitally is a simple API monitoring and analytics tool that makes it easy to understand API usage, monitor performance, and troubleshoot issues. Get started in minutes by just adding a few lines of code. No infrastructure changes required, no dashboards to build.

Learn more about Apitally on our 🌎 website or check out the 📚 documentation.

Key features

API analytics

Track traffic, error and performance metrics for your API, each endpoint and individual API consumers, allowing you to make informed, data-driven engineering and product decisions.

Request logs

Drill down from insights to individual API requests or use powerful search and filters to find specific requests. View correlated application logs and traces for a complete picture of each request, making troubleshooting faster and easier.

Error tracking

Understand which validation rules in your endpoints cause client errors. Capture error details and stack traces for 500 error responses, and have them linked to Sentry issues automatically.

API monitoring & alerts

Get notified immediately if something isn't right using custom alerts, synthetic uptime checks and heartbeat monitoring. Alert notifications can be delivered via email, Slack and Microsoft Teams.

Supported frameworks

Framework Supported versions Setup guide
FastAPI * >=0.94.1 Link
Flask >=2.0.0 Link
Django REST Framework >=3.10.0 Link
Django Ninja >=1.0.0 Link
Starlette >=0.26.1 Link
Litestar >=2.4.0 Link
BlackSheep >=2.0.0 Link

* For FastAPI on Cloudflare Workers use our Python Serverless SDK instead.

Apitally also supports many other web frameworks in JavaScript, Go, .NET and Java via our other SDKs.

Getting started

If you don't have an Apitally account yet, first sign up here. Then create an app in the Apitally dashboard. You'll see detailed setup instructions with code snippets you can copy and paste. These also include your client ID.

See the SDK reference for all available configuration options, including how to mask sensitive data, customize request logging, and more.

FastAPI

Install the SDK with the fastapi extra:

pip install "apitally[fastapi]"

Then add the Apitally middleware to your application:

from fastapi import FastAPI
from apitally.fastapi import ApitallyMiddleware

app = FastAPI()
app.add_middleware(
    ApitallyMiddleware,
    client_id="your-client-id",
    env="dev",  # or "prod" etc.
)

For further instructions, see our setup guide for FastAPI.

Django

Install the SDK with the django_rest_framework or django_ninja extra:

pip install "apitally[django_rest_framework]"
# or
pip install "apitally[django_ninja]"

Then add the Apitally middleware to your Django settings:

MIDDLEWARE = [
    "apitally.django.ApitallyMiddleware",
    # Other middleware ...
]
APITALLY_MIDDLEWARE = {
    "client_id": "your-client-id",
    "env": "dev",  # or "prod" etc.
}

For further instructions, see our setup guide for Django.

Flask

Install the SDK with the flask extra:

pip install "apitally[flask]"

Then add the Apitally middleware to your application:

from flask import Flask
from apitally.flask import ApitallyMiddleware

app = Flask(__name__)
app.wsgi_app = ApitallyMiddleware(
    app,
    client_id="your-client-id",
    env="dev",  # or "prod" etc.
)

For further instructions, see our setup guide for Flask.

Starlette

Install the SDK with the starlette extra:

pip install "apitally[starlette]"

Then add the Apitally middleware to your application:

from starlette.applications import Starlette
from apitally.starlette import ApitallyMiddleware

app = Starlette(routes=[...])
app.add_middleware(
    ApitallyMiddleware,
    client_id="your-client-id",
    env="dev",  # or "prod" etc.
)

For further instructions, see our setup guide for Starlette.

Litestar

Install the SDK with the litestar extra:

pip install "apitally[litestar]"

Then add the Apitally plugin to your application:

from litestar import Litestar
from apitally.litestar import ApitallyPlugin

app = Litestar(
    route_handlers=[...],
    plugins=[
        ApitallyPlugin(
            client_id="your-client-id",
            env="dev",  # or "prod" etc.
        ),
    ]
)

For further instructions, see our setup guide for Litestar.

BlackSheep

Install the SDK with the blacksheep extra:

pip install "apitally[blacksheep]"

Then add the Apitally middleware to your application:

from blacksheep import Application
from apitally.blacksheep import use_apitally

app = Application()
use_apitally(
    app,
    client_id="your-client-id",
    env="dev",  # or "prod" etc.
)

For further instructions, see our setup guide for BlackSheep.

Getting help

If you need help please create a new discussion on GitHub or email us at support@apitally.io. We'll get back to you as soon as possible.

License

This library is licensed under the terms of the MIT license.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apitally-0.24.3.tar.gz (225.2 kB view details)

Uploaded Source

Built Distribution

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

apitally-0.24.3-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

Details for the file apitally-0.24.3.tar.gz.

File metadata

  • Download URL: apitally-0.24.3.tar.gz
  • Upload date:
  • Size: 225.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for apitally-0.24.3.tar.gz
Algorithm Hash digest
SHA256 ddb22686ccbed9e4d1638186f18bec4e08ba5e63bb383e8c93013fba4031c9a2
MD5 42dccb7655c6f9572f3d751c97be7b75
BLAKE2b-256 caadb34f7f05e17b8e1ac7298580ae3a7933432588b5b62281d27cd43b519c4d

See more details on using hashes here.

File details

Details for the file apitally-0.24.3-py3-none-any.whl.

File metadata

  • Download URL: apitally-0.24.3-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for apitally-0.24.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8825bf9e8c54068dc1b62c152dfad034467d80d35d4b1aaed85064503a8375c5
MD5 8c0450e2acd8c0880512d9e2f270d8a5
BLAKE2b-256 9f483576b5761449195cbdf5280d2ae5b61efea9772781db8348698d58b5c2e7

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