Developer Guide
API keys, authentication, your first call, widget embedding, and common errors — in one place.
Find Your API Key
Your API key is generated automatically when you create a Triangle account. It does not expire unless you rotate it manually.
Open your developer portal
triangle-trade-intel.site/developer — log in with your account email. This is your API key management dashboard.
Find your key
Your key is listed under API Credentials. You will see up to three key types — test, live, and widget-only.
Copy the full key
Keys are truncated in the UI display. Always use the copy button rather than selecting text manually.
Your key is a secret. Never include it in client-side JavaScript, public repositories, or URLs. Anyone with your key can make API calls against your credit balance. Use widget keys (tri_widget_*) for browser-side embed code — they are domain-restricted.
Base URL
All API requests go to the same base URL:
Your First API Call
The fastest way to confirm your key is working is a single /classify call.
A successful response returns:
The gri_reasoning field is the audit trail. It documents how the classification was reached using the General Rules of Interpretation, with a Federal Register citation. This is what makes a classification CBP-defensible.
Authentication
Every request requires a Bearer token in the Authorization header.
Store as an environment variable
Core Endpoints
The Triangle API has 65 endpoints. These four are the ones most integrations use first. Full reference →
/classifyClassifies a product description into an 8-digit HTS code. Returns the full duty stack and GRI reasoning trail. Only this endpoint accepts product descriptions — all others require hs_code.
Key param: description (string, required)
/duty-calculateReturns the complete duty stack for a given HTS code. Includes MFN, Section 301, Section 232, Section 122 (10%, Feb 24 2026), and AD/CVD orders with Federal Register citations.
Key param: hs_code (string, required)
/tariff-ratesReturns market-specific duty rates. Supports all 9 markets: us, mx, ca, jp, eu, br, in, vn, cptpp.
Key param: hs_code (string, required)
/usmca-qualifyUSMCA origin qualification analysis. Pass the component breakdown — the API calculates Regional Value Content, checks the rule of origin, and returns the preference criterion.
Key param: hs_code + components (array)
Common mistake: The market parameter belongs on /tariff-rates, not /classify. Passing it to /classify returns an error.
Embeddable Widgets
7 pre-built widgets. Available on Starter and above. Use a tri_widget_live_* key (domain-restricted) or your standard API key.
Tariff Rate Lookup
MFN + Section 301/232/122 stacking
Intelligent HS Classifier
Full AI classification with guided interview
USMCA Qualification
RVC analysis and preference criterion
Mexico ROI Calculator
Nearshoring savings with duty breakdown
CBP Entry Review
Pre-filing risk scoring and red flags
IEEPA Refund Estimator
Historical refund calculator (post-Feb 20, 2026)
Audit Export
CBP-ready documentation export
Embedding a widget
One script tag per widget. Swap the src filename for the widget you want.
Widget key visibility: The data-key attribute is visible in page source. Use a tri_widget_live_* key and set domain restrictions in your developer portal before deploying to production.
Plans and Credit Limits
All plans include all 65 endpoints and all 9 markets. No endpoint gating. What changes is credits per month, rate limit, and overage pricing.
| Plan | Credits/mo | Rate limit | Overage | Price |
|---|---|---|---|---|
| Free | 100 | 10 req/min | Blocked at limit | $0 |
| Starter | 500 | 30 req/min | $0.05/credit | $49/mo |
| Pro | 3,000 | 60 req/min | $0.03/credit | $199/mo |
| Business | 12,000 | 150 req/min | $0.02/credit | $599/mo |
| Enterprise | 50,000+ | 300 req/min | Custom | Custom |
When your free credit balance hits zero the API returns a credits_exhausted error. Your key stays active. Upgrade at api-pricing →