Trestle - Identity Data Enrichment and Validation APIs Trestle - Identity Data Enrichment and Validation APIs Trestle - Identity Data Enrichment and Validation APIs Trestle - Identity Data Enrichment and Validation APIs
  • Products
        • Enrichment

        • Reverse Phone APIGLOBAL
        • Verify and enrich phone numbers
        • Reverse Address API
        • Verify and enrich address information
        • Caller Identification API
        • Identify and enrich caller information
        • Add-Ons

        • Litigator Check
        • Identify phone numbers associated with serial litigators
        • Email Deliverability
        • Confirm email inboxes accept mail in real-time
        • Spam Check
        • Flag phone numbers tied to high-risk calling activity
        • Email Age Score
        • Score how long an email has existed
        • Validation & Verification

        • Phone Validation APIGLOBAL
        • Validate phone numbers and identify disconnected numbers
        • Real Contact API
        • Verify phone, email, and address information
        • Address Validation API
        • Validate and normalize addresses
        • Assess Risk

        • Decision Console
        • Optimize identity verification for manual review
        • Decision Signals API
        • Automate identity verification for risk decisioning
        • Start using Trestle products today

          Get started for free—no credit card required

          Start Your Free Trial

  • Solutions
        • Industries

        • B2B Contact Data
        • eCommerce
        • Insurance
        • Lead Generation
        • Real Estate
        • Communications
        • Use Cases

        • Verify and Prioritize Leads
        • Outbound Dialing Optimization
        • Assess Risk And Prevent Fraud
        • Inbound Call Routing and Verification​
        • Signup and Onboarding​
        • Optimize AI Voice Agents
        • Start using Trestle products today

          Get started for free—no credit card required

          Start Your Free Trial

  • Pricing
  • Resources
        • API Documentation
        • Blog
        • Knowledge Base
        • Case Studies
        • Glossary
        • Partners and Integrations
  • Company
        • About Us
        • Why Trestle
        • Careers
        • Affiliate Program
        • Contact
  • Log In
  • Start for Free

Trestle Overview

19
  • Does Trestle Offer DNC Checks?
  • Does Trestle Have a Sandbox Environment To Test Integrations?
  • What is Trestle’s Coverage and Accuracy?
  • Which Countries’ Data Do You Have?
  • Does Trestle Normalize Phone Number Format?
  • How Do You Integrate Trestle’s APIs?
  • How Does Trestle’s API Pricing Work?
  • How Often is Trestle’s Data Updated?
  • How to Properly Sample a Test File and Evaluate Trestle
  • Understanding NPA-NXX and the Implications of Number Portability
  • Understanding Trestle’s Free API Trial and the API Access Request Process for Specific Products
  • What are the Response Times for Trestle’s APIs?
  • What are the Various Sources of Trestle’s Identity Data?
  • What are Trestle’s SLAs?
  • What Demographic Data Does Trestle Have?
  • What Is Our Global Phone Validation Coverage?
  • What is the Default and Max QPS Supported?
  • What Queries are Billable?
  • What Security Measures are Taken by Trestle?

Product Features

39
  • Everything to Know About Source ID
  • Everything to Know About IP Trust Scores
  • How to Check When an Email Address Was Made
  • Everything to Know About Spam Checks
  • Using IP Intelligence Checks to Verify Lead Legitimacy in Real Contact API
  • Everything to Know About Phone-to-Address Match
  • Real Contact API 1.1 vs. Real Contact API 2.0: What’s Changed and How to Upgrade
  • Everything to Know About Phone Activity Score
  • Everything to Know About Real Contact API 2.0
  • How Trestle’s Activity Score is Different From HLR Lookups
  • Everything To Know About Name Match Details
  • Everything To Know About Phone-to-Name Confidence Score
  • Everything To Know About Litigator Checks
  • Everything To Know About the Email Age Score Add-on
  • Everything To Know About the Email Deliverability Add-on
  • Explain Real Contact API Grading
  • Fine-Tuning Find Person API Results
  • How Can Trestle’s Email Data Be Used?
  • How Do I Determine Phone Validity?
  • How Do You Read Trestle’s Phone Activity Score?
  • How Does Our Real Contact API Name Matching Work?
  • How Does Trestle Assess Email Validity in Real Contact?
  • How is Trestle’s Phone Activity Score Calculated?
  • How To Read the Real Contact Data Assessment Report
  • International Reverse Phone API Explained
  • Line Type Fidelity and Confidence
  • Trestle API Response Attribute Ranking
  • Trestle Warnings – A Comprehensive Guide
  • Understanding the Difference: Phone Validity vs. Trestle’s Activity Score
  • What are the Different Address Types Returned by Trestle?
  • What Does a Name Match of Null Mean?
  • What Does the Carrier Name Mean?
  • What is the Difference Between CNAM and Trestle’s Smart CNAM API?
  • What is the Difference Between Fixed VoIP and Non-fixed VoIP?
  • What is the Difference Between Reverse Phone API, Caller Identification API, and Smart CNAM API?
  • What is the Link Date Associated with Phones and Addresses?
  • Why and When to Use Trestle’s Name Hint
  • Why Do We Return a Maximum of 100 Entities in Find Person API?
  • Why Does the Address Return as Invalid?

Integrations

22
  • HubSpot | Phone Validation App Integration Guide
  • ZoomInfo | Phone Validation, Real Contact, and Reverse Phone Integration Guide
  • Databar | Phone Validation Integration Guide
  • Make | Real Contact API Integration Guide
  • Make | Phone Validation API Integration Guide
  • Apollo | Phone Validation Integration Guide
  • HighLevel | Phone Validation Integration Guide
  • boberdoo | Real Contact API Integration Guide
  • Clay | Validate Phone Number Integration Guide
  • Clay | Verify Contact Integration Guide
  • HubSpot | Real Contact Phone Grading App Integration Guide
  • How Do I Use a HubSpot List To Grade My Contacts?
  • How Do I Use HubSpot Workflow Triggers To Grade My Contacts?
  • Lead Prosper | Phone Validation Integration Guide
  • Lead Prosper | Real Contact Integration Guide
  • Reverse Phone API Enrichment of Leads in Google Sheets via Zapier
  • Snowflake | Phone Validation Integration Guide
  • What is the Phone Validation Integration within ActiveProspect?
  • What is the Real Contact Integration within ActiveProspect?
  • Validate and Verify Leads with Trestle’s Phone Validation API in Sierra Interactive via Zapier
  • Validate Leads with Trestle’s Phone Validation API in LeadConnector via Zapier
  • Zapier | Grade Leads from a Google Sheet with Real Contact

Troubleshooting

9
  • How to Prevent 429 Errors by Sizing API Concurrency to Your QPS Limit
  • How to Fix 403 Forbidden Errors When Using Trestle’s APIs
  • Why Won’t My Email Work to Signup for Trestle?
  • Ruby Integrations: 403 Forbidden Errors
  • Getting 429: Too Many Requests Error – Why?
  • How to Remove or Deactivate a User in Trestle’s Developer Portal
  • How to Update Phone to Name/Address Linkage Records
  • Reviewing Usage Data
  • Why is the Name Associated with the Phone Incorrect?

Developer Portal

8
  • Business Verification Failed? Here’s What Documents You Need to Submit
  • How to Find and Download Your Receipt or Invoice
  • How to Monitor API Errors With Your Usage Graph
  • Batch Upload FAQ
  • Developer Portal Wallet Frequently Asked Questions
  • Export and Analyze Your Queries in Your Developer Portal Account
  • Getting Started with Trestle’s Developer Portal Wallet
  • Making Changes to Billing Settings for the Developer Portal Wallet

User Guides

9
  • Phone Validation in Java
  • Batch Upload Instructions
  • How Do I add Additional Members to My Trestle Account?
  • How to Handle Special Characters in API Queries
  • Phone Validation API with ASP.NET
  • Phone Validation with JavaScript and HTML: Leveraging Trestle’s API
  • Phone Validation API with PHP: Leveraging Trestle’s API
  • Phone Validation API with Python
  • Phone Validation API with React

Telephony Knowledge

9
  • Choosing the Right Number Lookup API
  • How to Identify Callers In Real-Time Using a Reverse Phone API
  • Why is Line Type Intelligence Important?
  • What is a “No Routes Found” Phone Message?
  • The Best Phone Validation API for Call Centers
  • How to Identify Disconnected Phone Numbers Automatically
  • What is a Phone Number Reputation Lookup?
  • What is a Carrier Number?
  • What is a Non-Fixed VoIP Phone?

Risk Suite Overview

8
  • How to Read Email Breach Reports and IP Abuse Reports in Decision Console
  • Everything to Know About Decision Signals API
  • How to Get Started With Decision Console
  • What is the Decision Overview and How Do I Read It?
  • What is an Attribute Card and How Do I Read It?
  • What is Link Builder and How Do I Use It?
  • Understanding Team and Account Management
  • FAQ and Troubleshooting: Decision Console
  • Home
  • Knowledge Base
  • Troubleshooting
  • How to Prevent 429 Errors by Sizing API Concurrency to Your QPS Limit
View Categories

How to Prevent 429 Errors by Sizing API Concurrency to Your QPS Limit

10 min read

If you’re seeing 429 errors while your average request rate is under your plan’s limit, the fix is usually in how your integration spaces its requests and not the size of your plan. This guide applies to all Trestle APIs, including Phone Validation API, Real Contact API, Address Validation API, Reverse Phone API, Reverse Address API, Caller Identification API, and Decision Signals API.

What You Will Learn #

  • The difference between QPS and concurrency
  • Why bursts trigger 429 errors even when your average rate is under your limit
  • How to calculate the right thread count from your measured latency
  • How to handle 429 responses with backoff
  • Working code samples in Python, Node.js, and Java

What Is the Difference Between QPS and Concurrency? #

Your throughput and your concurrency are related, but they are not the same number. Treating them as interchangeable is a common cause of avoidable 429 errors.

What is QPS? #

QPS (queries per second) is the number of requests your integration sends to an API each second. Every Trestle account has a contracted QPS limit. For how limits are assigned, check out What is the Default and Max QPS Supported?

What is Concurrency? #

Concurrency is the number of requests your integration has in flight at the same time. In a threaded client, it’s your thread count. In an async runtime like Node.js, it’s the number of pending requests.

What is Round-Trip Latency? #

Round-trip latency is the time between sending a request and receiving the full response, as measured by your own client. It includes two parts:

  1. Trestle’s processing time. Published P50 and P95 values for each API are listed in What are the Response Times for Trestle’s APIs? and are measured inside Trestle’s firewall. 
  2. Your network time to Trestle. Trestle’s APIs are hosted in the U.S.-West region. As a rule of thumb, add up to about 150ms of round-trip wait time for a coast-to-coast connection. 

Only you can observe the network path, so always measure latency with a request timer in your own client. 

How Are the Three Related? #

Your thread count, your target QPS, and your latency are tied together by how a thread works. Each thread sends a request, waits for the response, then sends the next. The longer each response takes, the fewer requests a single thread can send per second, and the more threads you need to reach your target. 

The first formula calculates your thread count directly. Dividing your latency by 1000 converts it from milliseconds to seconds, and multiplying by your target QPS tells you how many requests need to be in flight at once:

Threads needed = Target QPS x (Round-trip latency in ms➗ 1000)

Equivalently, one thread sustains 1000➗ latency_ms QPS, so:

Threads needed = Target QPS ➗ (1000 ➗ latency_ms)

The second formula reaches the same answer in two steps. First, 1000 ➗ latency_ms tells you how many requests one thread can complete per second. Then, dividing your target QPS by that per-thread capacity tells you how many threads it takes to hit your target. Use whichever version is easier for you; both return the same number.

Only the latency changes between APIs. The formula and thread counts are the same for every Trestle API, whether a Phone Validation lookup or a Decision Signals API call. What differs is the processing time itself. Simpler calls typically complete faster than calls that enrich or cross-reference multiple data sources. Measure latency separately for each API you integrate, and size each integration’s thread pool independently.

Worked Example #

Target: 256 QPS. Measured round-trip latency for the API you’re calling: 400ms.

  • One thread sustains 1000 ➗ 400 = 2.5 QPS
  • Threads needed: 256 ➗ 2.5 = 102.4, rounded up to 103 threads

With 103 threads, each thread sends a request, waits about 400ms for the response, then sends the next. Across the threads, requests are naturally staggered, so the 256 QPS spreads evenly across the whole second instead of arriving in a spike.

By contrast, running 256 threads at 400ms latency makes you capable of 256 x 2.5 = 640 QPS, which is 2.5x your target, and that capacity arrives in bursts. Right-sizing to 103 threads keeps you on-target and smooth.

Your own number will differ by API, region, and network path. Use what you measure for the specific endpoint you’re integrating. 

Quick Reference #

Threads needed for a target of 256 QPS at each measured latency (rounded up):

Round-trip latencyQPS per threadThreads needed
100ms10.026
250ms4.064
300ms3.377
350ms2.990
400ms2.5103
500ms2.0128
600ms1.7154
800ms1.25205
1000ms1.0256

For a different target QPS, scale proportionally:

Threads = (target QPS ➗ 256) x (value in the table)

What Happens if You Exceed Your Limit? #

Requests over your plan’s QPS limit will hit a 429 error. If your integration sends requests faster than your contracted QPS (on average or in a burst) on any Trestle API, the excess requests are rejected. A 429 error is a signal to pause briefly and retry with exponential backoff. Don’t retry immediately at the same rate, as that will continue to be rejected.

If you’re seeing a 429 error while your average QPS is comfortably under your plan’s limit, the cause is usually a burst pattern rather than an undersized plan. Revisit the thread sizing above before requesting a higher limit, or check out Getting 429: Too Many Requests Error – Why? to learn how QPS limits are assigned. If you need a higher tier, reach out to support@trestleiq.com. 

Code Samples #

Each sample below starts a fixed pool of threads sized with the formula above, where every thread runs a closed loop: send a request, wait for the response, and then send the next. No manual delay is needed. Waiting for the response is the pacing. 

Python #

import math, random, threading, time
import requests

# Placeholders: replace with your endpoint URL and your API key header.
API_URL = "https://api.trestleiq.com/..."
AUTH_HEADERS = {"x-api-key": "YOUR_API_KEY"}

TARGET_QPS = 256
LATENCY_S = 0.4  # your measured round-trip latency, in seconds
THREADS = math.ceil(TARGET_QPS * LATENCY_S)  # ~103

running = True

def worker(session):
    while running:
        response = session.get(API_URL, headers=AUTH_HEADERS)
        if response.status_code == 429:
            time.sleep(1 + random.random())  # back off, then retry
            continue
        # process response; no sleep here -- the request itself paces the loop

threads = [
    threading.Thread(target=worker, args=(requests.Session(),), daemon=True)
    for _ in range(THREADS)
]
for t in threads:
    t.start()
for t in threads:
    t.join()

Node.js #

// Placeholders: replace with your endpoint URL and your API key header.
// Top-level await requires an ES module (.mjs, or "type": "module" in package.json).
const API_URL = "https://api.trestleiq.com/...";
const AUTH_HEADERS = { "x-api-key": "YOUR_API_KEY" };

const TARGET_QPS = 256;
const LATENCY_S = 0.4; // your measured round-trip latency, in seconds
const THREADS = Math.ceil(TARGET_QPS * LATENCY_S); // ~103

let running = true;
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

async function worker() {
  while (running) {
    const res = await fetch(API_URL, { headers: AUTH_HEADERS });
    if (res.status === 429) {
      await sleep(1000 + Math.random() * 1000); // back off, then retry
      continue;
    }
    // process response; no delay here -- awaiting fetch() paces the loop
  }
}

await Promise.all(Array.from({ length: THREADS }, () => worker()));

Java #

// Placeholder: build `request` with your endpoint URL and your API key header.
HttpRequest request = HttpRequest.newBuilder()
        .uri(URI.create("https://api.trestleiq.com/..."))
        .header("x-api-key", "YOUR_API_KEY")
        .GET()
        .build();

int targetQps = 256;
double latencySeconds = 0.4; // your measured round-trip latency, in seconds
int threads = (int) Math.ceil(targetQps * latencySeconds); // ~103

ExecutorService pool = Executors.newFixedThreadPool(threads);
AtomicBoolean running = new AtomicBoolean(true);
HttpClient client = HttpClient.newHttpClient();

for (int i = 0; i < threads; i++) {
    pool.submit(() -> {
        while (running.get()) {
            try {
                HttpResponse<String> response =
                    client.send(request, HttpResponse.BodyHandlers.ofString());
                if (response.statusCode() == 429) {
                    Thread.sleep(1000 + ThreadLocalRandom.current().nextInt(1000)); // back off, then retry
                    continue;
                }
                // process response; the blocking send() call paces the loop
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt(); // restore interrupt status and stop this worker
                return;
            } catch (IOException e) {
                // network error: log it, then continue the loop to retry
            }
        }
    });
}

Best Practices #

  1. Use a closed-loop client. Each thread should send one request, wait for the response, then send the next. Never fire all threads on a fixed timer at the top of each second. 
  2. Measure your own latency. Use your observed average (P50) round-trip time. This includes your network path, not just Trestle’s published processing time. 
  3. Recompute when latency changes. If your network latency changes, or you add hops such as a VPN, proxy, or gateway, your effective latency rises. International phone queries also run slower than U.S. queries. Plug the new number into the formula and adjust your thread count. If latency jumps unexpectedly, check API Live Status. 
  4. Add light jitter. A few milliseconds of random start offset per thread prevents threads from accidentally drifting into alignment and forming bursts. 
  5. If you use an open-loop rate limiter, pace it evenly. A token bucket limiter holds a fixed number of “tokens” that refill at a steady rate, and each request spends one. Set the refill rate to your target QPS so requests are spaced evenly. Never release a whole second’s budget at once. 

Summary #

Threads do not equal QPS. Threads = QPS x latency (in seconds). That’s why you should size threads to your measured round-trip latency, so load spreads evenly across each second. Keep in mind that running more threads than the formula gives you will create bursts and 429s, not more usable throughput.

If you’ve sized your threads to your latency and are still seeing 429s, or you need a higher QPS tier, contact your account executive or email support@trestleiq.com. 

Updated on September 24, 2026
Why is the Name Associated with the Phone Incorrect?How to Fix 403 Forbidden Errors When Using Trestle’s APIs
Table of Contents
  • What You Will Learn
  • What Is the Difference Between QPS and Concurrency?
    • What is QPS?
    • What is Concurrency?
    • What is Round-Trip Latency?
    • How Are the Three Related?
  • Worked Example
  • Quick Reference
  • What Happens if You Exceed Your Limit?
  • Code Samples
    • Python
    • Node.js
    • Java
  • Best Practices
  • Summary
trestleLogo

Verified Identities. Trusted Interactions.

U.S. coverage for enrichment and verification.

Global coverage for phone validation and reverse phone.

Based in Bellevue, WA

Linkedin Github Postman

Company

  • About Us
  • Why Trestle
  • Careers
  • Affiliate Program
  • Contact

Products

  • Reverse Phone API
  • Reverse Address API
  • Caller Identification API
  • Phone Validation API
  • Real Contact API
  • Address Validation API
  • Batch Upload
  • Litigator Check Add-on
  • Free Lead Assessment

Use Cases

  • Outbound Dialing Optimization
  • Inbound Call Routing and Verification
  • Signup and Onboarding
  • Lead Verification
  • Optimize AI Voice Agents

Resources

  • Blog
  • Knowledge Base
  • Case Studies
  • Glossary
  • Data Dictionary
  • Changelog
  • Partners and Integrations

Developers

  • Developer Portal
  • API Documentation
  • API Live Status

Legal

  • Terms of Service
  • Privacy Policy
  • Data Processing Agreement
  • Service Level Agreement
  • Do Not Sell My Personal Information
Trestle - Identity Data Enrichment and Validation APIs
  • Products
        • Enrichment

        • Reverse Phone APIGLOBAL
        • Verify and enrich phone numbers
        • Reverse Address API
        • Verify and enrich address information
        • Caller Identification API
        • Identify and enrich caller information
        • Add-Ons

        • Litigator Check
        • Identify phone numbers associated with serial litigators
        • Email Deliverability
        • Confirm email inboxes accept mail in real-time
        • Spam Check
        • Flag phone numbers tied to high-risk calling activity
        • Email Age Score
        • Score how long an email has existed
        • Validation & Verification

        • Phone Validation APIGLOBAL
        • Validate phone numbers and identify disconnected numbers
        • Real Contact API
        • Verify phone, email, and address information
        • Address Validation API
        • Validate and normalize addresses
        • Assess Risk

        • Decision Console
        • Optimize identity verification for manual review
        • Decision Signals API
        • Automate identity verification for risk decisioning
        • Start using Trestle products today

          Get started for free—no credit card required

          Start Your Free Trial

  • Solutions
        • Industries

        • B2B Contact Data
        • eCommerce
        • Insurance
        • Lead Generation
        • Real Estate
        • Communications
        • Use Cases

        • Verify and Prioritize Leads
        • Outbound Dialing Optimization
        • Assess Risk And Prevent Fraud
        • Inbound Call Routing and Verification​
        • Signup and Onboarding​
        • Optimize AI Voice Agents
        • Start using Trestle products today

          Get started for free—no credit card required

          Start Your Free Trial

  • Pricing
  • Resources
        • API Documentation
        • Blog
        • Knowledge Base
        • Case Studies
        • Glossary
        • Partners and Integrations
  • Company
        • About Us
        • Why Trestle
        • Careers
        • Affiliate Program
        • Contact
  • Log In
  • Start for Free