Getting Started

Integration guide

Getting Started

1

Create an API Account

Sign up for a free API account at api.gatewaylines.com/signup. Once registered, you can generate API keys and start making requests immediately.

Already a Gateway shipping customer? You can log in with your existing account.

2

Generate an API Key

Navigate to API Keys in your API portal. Click "Create New Key" and give it a descriptive name.

Free Tier

Prefix: gw_...
100 API calls per month. Perfect for testing.

Tariff Pro ($199/mo)

Prefix: gw_...
10,000 API calls per month. Built-in calculator and branded reports.

Save your API key immediately

Your API key is only shown once. Copy it to a secure location. If lost, generate a new one.

3

Make Your First Request

Test your API key with a tariff calculation:

curl -X POST "https://api.gatewaylines.com/api/tariff/public/calculate" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: gw_your_key_here" \
  -d '{"hts_code": "8471.30.01", "country_code": "CN", "declared_value": 10000}'

Response:

{
  "hts_code": "8471.30.01",
  "description": "Portable digital automatic data processing machines...",
  "total_tariff_rate": 145,
  "total_duty": 14500,
  "remaining": 99
}
4

Explore All Endpoints

Check the full API reference for all available endpoints: tariff calculation, AI HTS search, container tracking, CO2 emissions, port congestion, 3D load planner, and parcel quotes.

Rate Limits

To ensure fair usage, all API requests are subject to rate limiting.

Free Tier

100 / month

Shared across general endpoints. Resets monthly.

Tariff Pro ($199/mo)

10,000 / month

All endpoints + unlimited CO2 + unlimited ports.

Separate Limits

CO2 Emissions5/week free, unlimited Pro
Port Congestion5 unlocks/month free, unlimited Pro
Container TrackingCredit-based (from $15/mo)

Rate Limit Headers

Every response includes headers to track your usage:

X-RateLimit-Limit: 100

X-RateLimit-Remaining: 97

X-RateLimit-Reset: 1775196000

Need higher limits? Contact [email protected] for enterprise rate limits.

Best Practices

API Key Security

  • Store API keys in environment variables, never in code
  • Use different keys for development and production
  • Rotate keys periodically (every 90 days recommended)
  • Revoke compromised keys immediately

Error Handling

  • Always check HTTP status codes before parsing responses
  • Implement exponential backoff for 429 (rate limit) errors
  • Cache tariff responses where appropriate to reduce calls
  • Handle network timeouts gracefully (30s recommended)

Frequently Asked Questions

Support

API Reference

Complete endpoint documentation with examples

View API Docs

Email Support

Technical questions and integration help

[email protected]

Status Page

Real-time API status and incidents

View Status

Enterprise Support

Need dedicated support, custom integrations, or higher rate limits?

Contact Enterprise Sales