What Is the Billing Markup Applied to DataForSEO API Costs in OpenSEO?

OpenSEO applies a fixed 28% billing markup to raw DataForSEO API costs for hosted customers, charging $1.28 for every $1.00 of third-party fees.

OpenSEO is an open-source SEO platform that integrates with DataForSEO to deliver keyword research and ranking data. When operating in hosted mode, the platform adds a standardized markup to third-party API costs before passing them to end users. This article examines the exact multiplier, the helper functions that apply it, and the conditional logic that distinguishes hosted billing from self-hosted deployments.

Markup Configuration in src/shared/billing.ts

The billing multiplier is defined as a constant export in the shared billing module. In src/shared/billing.ts, the platform declares:

export const SEO_DATA_COST_MARKUP = 1.28; // 28% markup

This 28% markup factor is the single source of truth for all DataForSEO cost calculations throughout the application. The constant is imported by both server-side billing logic and client-side pricing displays to ensure consistency across the platform.

The applyBillingMarkupUsd Calculation Logic

To standardize the application of this markup, OpenSEO provides a dedicated helper function in the same file. The applyBillingMarkupUsd function accepts a raw dollar amount and returns the marked-up total:

export function applyBillingMarkupUsd(rawUsd: number): number {
  return roundUsdForBilling(rawUsd * SEO_DATA_COST_MARKUP);
}

The function multiplies the input by 1.28 and passes the result through roundUsdForBilling to ensure currency-appropriate precision. For every dollar reported by DataForSEO, hosted customers are charged $1.28 USD.

Hosted vs. Self-Hosted Billing Behavior

The markup is not universal; it is conditionally applied based on the deployment mode. According to the billing usage flow in src/serverFunctions/billing.ts, the platform checks isHostedServerAuthMode() before applying fees.

  • Hosted deployments: When isHostedServerAuthMode() returns true, OpenSEO applies the SEO_DATA_COST_MARKUP to all DataForSEO API usage.
  • Self-hosted deployments: Users running their own instances bypass this markup entirely and pay the raw DataForSEO rate directly to the provider.

This distinction ensures that self-hosted users retain direct control over their third-party API expenses while the hosted service model covers platform operational costs through the 28% surcharge.

Practical Implementation Examples

Calculating Billed Costs in TypeScript

When displaying cost estimates or processing usage reports, import the helper from the shared billing module:

import { applyBillingMarkupUsd } from "@/shared/billing";

// Raw cost returned by Data For SEO (e.g., $10.00)
const rawCost = 10.0;

// Cost shown to a hosted user
const billedCost = applyBillingMarkupUsd(rawCost);
// billedCost === 12.8
console.log(`Billed amount: $${billedCost}`);

Displaying Marked-Up Prices in React Components

The pricing page and usage dashboards reference the markup constant directly to show transparency. In components like those found in web/src/routes/_marketing/pricing.tsx and src/client/features/brand-lookup/BrandLookupSearchCard.tsx, the calculation appears as:

import { SEO_DATA_COST_MARKUP } from "@/shared/billing";

function PricingCard({ rawUsd }: { rawUsd: number }) {
  const displayedUsd = Math.round(rawUsd * SEO_DATA_COST_MARKUP * 100) / 100;
  return (
    <div>
      <p>Raw Data For SEO cost: ${rawUsd.toFixed(2)}</p>
      <p>Open SEO price (incl. markup): ${displayedUsd.toFixed(2)}</p>
    </div>
  );
}

This pattern allows the UI to display both the raw DataForSEO base cost and the final marked-up price that hosted customers will pay.

Summary

  • 28% fixed markup: OpenSEO multiplies DataForSEO API costs by 1.28 for all hosted usage.
  • Centralized configuration: The multiplier is defined as SEO_DATA_COST_MARKUP in src/shared/billing.ts.
  • Helper function: applyBillingMarkupUsd() handles the calculation and rounding in one place.
  • Deployment-aware: The markup only applies when isHostedServerAuthMode() returns true; self-hosted users pay raw rates.
  • UI transparency: Components in pricing.tsx and BrandLookupSearchCard.tsx expose both raw and marked-up pricing to users.

Frequently Asked Questions

What is the exact billing markup percentage for DataForSEO API costs in OpenSEO?

OpenSEO applies a 28% markup to DataForSEO API costs. This is implemented as a multiplier of 1.28 defined in src/shared/billing.ts, meaning a $10.00 raw API cost becomes $12.80 on the customer invoice.

How does OpenSEO determine whether to apply the billing markup?

The platform checks the isHostedServerAuthMode() function within the billing flow in src/serverFunctions/billing.ts. If the deployment is identified as hosted, the markup is applied; if self-hosted, the calculation is bypassed and users pay raw DataForSEO rates directly.

Do self-hosted OpenSEO deployments pay the DataForSEO markup?

No. Self-hosted deployments bypass the SEO_DATA_COST_MARKUP entirely. The markup logic is gated by authentication mode checks, ensuring that only hosted platform customers receive invoices that include the 28% surcharge.

Where is the markup calculation function located?

The applyBillingMarkupUsd function is located in src/shared/billing.ts. This shared module is imported by both server-side billing processors and client-side pricing components to ensure consistent calculation across the entire application stack.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →