FeaturesPricingBlog

Traffic Intelligence Platform

Product

  • Features
  • Pricing
  • Documentation

Company

  • About
  • Blog
  • Contact

Legal

  • Privacy
  • Terms

© 2026 Magicgate. All rights reserved.

ProductFebruary 10, 20264 min read

API Mode vs Direct Mode: Choosing the Right Integration

Two ways to integrate traffic filtering into your workflow. We break down when to use each approach and the trade-offs involved.

When setting up a traffic filtering solution, one of the first decisions you'll make is how to integrate it with your existing workflow. Most platforms offer two approaches: an API you call from your own code, or a direct/redirect mode that handles everything automatically. Each has distinct advantages.

API Mode: Full Control for Developers

API Mode works through a simple HTTP request. You send a POST request with the visitor's attributes (IP address, user agent, headers, etc.) and receive a JSON response with the verdict: "offer" for legitimate traffic or "white" for filtered traffic. The main advantage of API Mode is flexibility. You control exactly how the verdict is used — redirect to different pages, serve different content inline, log additional data, or integrate with your existing backend logic. API Mode is ideal for: - Custom PHP, Node.js, or Python landing pages - Complex routing logic with multiple offer variations - Integration with existing analytics or tracking platforms - Server-side rendering where you need the verdict before page generation

Direct Mode: Zero-Code Integration

Direct Mode eliminates the need for any code changes. You point your domain to the filtering service, configure your offer and white page URLs, and the platform handles everything: visitor evaluation, routing decisions, and traffic redirection. Direct Mode supports several routing methods: - 302 Redirect: The visitor's browser is redirected to either the offer or white page URL. Simple and widely compatible. - Reverse Proxy: The filtering service fetches and serves the offer or white page content under your domain. The visitor never sees the actual destination URL. - Iframe Embed: The content is loaded in an iframe under your domain. Useful when you need to maintain a consistent URL. Direct Mode is perfect for marketers who want a plug-and-play solution.

Performance Comparison

Both modes can achieve sub-10ms verdict times when the underlying engine is fast. The difference is in the total request lifecycle: - API Mode adds one HTTP request to your server-side logic. If your server is close to the filtering service, this adds 5-20ms. - Direct Mode requires the visitor to hit the filtering service first, then get redirected. This adds a full round-trip, but the redirect itself is handled at the HTTP level so it's fast. In practice, both approaches are imperceptible to visitors. The choice should be based on your technical requirements, not performance concerns.

Which Should You Choose?

Choose API Mode if you have development resources, need custom routing logic, or want to integrate filtering into an existing codebase. Choose Direct Mode if you want the fastest setup, don't have server-side code, or prefer a managed solution where the platform handles all the routing. Many users start with Direct Mode for its simplicity and migrate to API Mode later when they need more control. The best platforms support both modes with the same filter engine, so you get identical protection regardless of your integration method.

Related Articles

Guide

What Is Cloaking and Why Smart Marketers Use It

Traffic cloaking is a technique that shows different content to different visitors based on their attributes. Learn how it works and why it matters for your campaigns.

Tips

5 Essential Filters Every Campaign Needs to Block Bot Traffic

Not all filters are created equal. These five filter types form the foundation of any effective traffic filtering setup.