Connect BotSnare Protection

Secure your website from malicious bots with our lightweight integration

Backend API Django Integration

For server-side protection in Django, implement our verification endpoint:

Django Example:

from django.shortcuts import redirect, render
from django.urls import path
from django.http import HttpResponse

# views.py
def home(request):
  # Redirect through BotSnare verification
  return redirect("https://botsnare.vercel.app/antibot/?next=https://yourdomain.com/index")

def index(request):
  # Only reached if verification passed
  return render(request, "index.html")

# urls.py
urlpatterns = [
  path('', home, name='home'),
  path('index/', index, name='index'),
]

Middleware Alternative (for API endpoints):

from django.http import HttpResponseForbidden
import requests

class BotSnareMiddleware:
  def __init__(self, get_response):
    self.get_response = get_response

  def __call__(self, request):
    # Skip verification for certain paths
    if request.path.startswith('/admin/') or request.path == '/verify-callback/':
      return self.get_response(request)

    if request.path == '/':
      return redirect("https://botsnare-api.vercel.app/verify?next=https://yourdomain.com/index")

    return self.get_response(request)

Key Features:

  • Two integration options: simple views or middleware
  • Middleware provides site-wide protection
  • Configurable exclusion paths (admin, etc.)
  • Real-time verification with BotSnare API
  • Works with Django REST Framework

Setup Instructions:

  1. Add the middleware to your MIDDLEWARE setting:
    MIDDLEWARE = [
      ...
      'yourapp.middleware.BotSnareMiddleware',
      ...
    ]
  2. Add the verification URLs to your urls.py
  3. Configure excluded paths in the middleware as needed
  4. Set up error handling for failed verifications

Backend API Integration

For server-side protection, implement our verification endpoint in your backend:

Flask Example:

from flask import Flask, redirect, render_template

app = Flask(__name__)

@app.route('/')
def home():
  # Redirect through BotSnare verification
  return redirect("https://botsnare.vercel.app/antibot/?next=https://yourdomain.com/index")

@app.route('/index')
def index():
  # Only reached if verification passed
  return render_template("index.html")

Key Features:

  • Seamless integration with any backend framework
  • Protects your API endpoints from automated abuse
  • Works alongside frontend protection for layered security
  • Customizable verification redirect URL

API Activation Required

To enable the backend API protection for your domain, you need to request activation from our support team.

  1. Contact our support via Telegram or Discord (links below)
  2. Provide your domain name that you want to protect
  3. Specify that you want to activate "API protection for website"
  4. Wait for confirmation - our team typically responds within 48 hours

Telegram Support

Contact our support agent on Telegram:

@BotSnare

Discord Support

Join our Discord server and open a ticket:

Discord Support Server

After activation, your domain will be whitelisted in our system and the API protection will start working immediately.

How It Works

BotSnare provides comprehensive protection at multiple levels:

Frontend Protection

  • Detects and blocks malicious bot traffic
  • Protects against automated attacks and scrapers
  • Operates silently without affecting real users

Backend API

  • Verifies requests before processing
  • Prevents API abuse and brute force attacks
  • Integrates with your existing backend

Key Benefits

Lightning Fast

Our solution adds minimal overhead with sub-50ms response times.

Layered Protection

Combines frontend and backend defenses for maximum security.

Easy Integration

Works with any tech stack through simple API calls.

Need Help?

Our team is ready to assist with integration: