DEV Community

Alex Spinov
Alex Spinov

Posted on

Sentry Has a Free API That Shows You Every Bug Before Users Report It

Sentry is the error tracking platform used by GitHub, Disney, and Cloudflare. Its API lets you programmatically monitor, triage, and resolve issues across all your applications.

What Is Sentry?

Sentry is an application monitoring platform that catches errors in real-time. Instead of waiting for users to report bugs, Sentry tells you the moment something breaks — with full stack traces, breadcrumbs, and user context.

The Sentry API

Sentry provides a comprehensive REST API for everything from issue management to release tracking.

Authentication

# Create auth token at sentry.io/settings/auth-tokens
export SENTRY_TOKEN="your-auth-token"
export SENTRY_ORG="your-org"
export SENTRY_PROJECT="your-project"

# List recent issues
curl -s "https://sentry.io/api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/issues/?query=is:unresolved" \
  -H "Authorization: Bearer $SENTRY_TOKEN" | jq '.[0:3] | .[] | {title, count, firstSeen}'
Enter fullscreen mode Exit fullscreen mode

Get Error Details

# Get latest event for an issue
curl -s "https://sentry.io/api/0/issues/ISSUE_ID/events/latest/" \
  -H "Authorization: Bearer $SENTRY_TOKEN" | jq '{message: .message, user: .user.email, browser: .contexts.browser.name}'
Enter fullscreen mode Exit fullscreen mode

Resolve Issues Programmatically

# Bulk resolve issues
curl -s -X PUT "https://sentry.io/api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/issues/" \
  -H "Authorization: Bearer $SENTRY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"status": "resolved", "id": ["123", "456", "789"]}'
Enter fullscreen mode Exit fullscreen mode

Create Releases

# Create a new release
curl -s -X POST "https://sentry.io/api/0/organizations/$SENTRY_ORG/releases/" \
  -H "Authorization: Bearer $SENTRY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"version": "v2.1.0", "projects": ["my-app"], "dateReleased": "2026-03-30T00:00:00Z"}'
Enter fullscreen mode Exit fullscreen mode

Real Use Case: Slack Alert Bot

import requests

SENTRY_TOKEN = "your-token"
SLACK_WEBHOOK = "https://hooks.slack.com/services/..."

def check_critical_errors():
    resp = requests.get(
        "https://sentry.io/api/0/projects/my-org/my-app/issues/",
        headers={"Authorization": f"Bearer {SENTRY_TOKEN}"},
        params={"query": "is:unresolved level:error", "limit": 5}
    )
    issues = resp.json()

    if issues:
        msg = f"*{len(issues)} unresolved errors:*\n"
        for issue in issues:
            msg += f"- [{issue['title']}]({issue['permalink']}) ({issue['count']} events)\n"

        requests.post(SLACK_WEBHOOK, json={"text": msg})

check_critical_errors()
Enter fullscreen mode Exit fullscreen mode

Sentry Free Tier

Feature Free Team ($26/mo)
Errors 5K/mo 50K/mo
Performance 10K/mo 100K/mo
Replays 50/mo 500/mo
API access Full Full
Team members 1 Unlimited

SDK Integration

import * as Sentry from '@sentry/node'

Sentry.init({
  dsn: 'https://key@sentry.io/project-id',
  tracesSampleRate: 0.1,
  environment: process.env.NODE_ENV,
})

// Errors are captured automatically
// Or capture manually:
Sentry.captureException(new Error('Something broke'))
Sentry.captureMessage('User did something unexpected')
Enter fullscreen mode Exit fullscreen mode

Getting Started

  1. Sign up at sentry.io (free tier available)
  2. Create a project
  3. Install SDK in your app
  4. Errors flow in automatically

Need to monitor web scraping jobs? Scrapfly provides built-in monitoring plus proxies and anti-bot bypass. Email spinov001@gmail.com for enterprise scraping solutions.

Top comments (0)