Quick Start
Get up and running with the Redirections API in under 30 minutes.
Quick Start
Get up and running with the Redirections API in under 30 minutes.
Prerequisites
- An active account (if you don't have one, sign up first)
- Basic familiarity with REST APIs and cURL or HTTP clients
Step 1: Create a Project (via Dashboard)
- Navigate to the Dashboard at your account homepage
- Click "New Project" button
- Enter a project name (e.g., "My Website Redirects")
- Click "Create"
- Note your Project ID - you'll see it in the project URL and settings
Time: ~2 minutes
Your Project ID is a unique identifier you'll use in all API requests. Keep it handy!
Step 2: Add Redirect Rules (via Dashboard)
- Open your newly created project
- Click "Add Rule" or "New Redirect" button
- Configure your first redirect:
- Source Path:
/blog/old-post - Destination Path:
/articles/new-post - Status Code:
301(Permanent Redirect) - Match Type:
Exact
- Source Path:
- Click "Save" to add the rule
- Repeat to add more redirect rules as needed
Time: ~5 minutes
Exact matches are checked first with O(1) lookup speed. Prefix matches are checked in priority order.
Step 3: Generate API Key (via Dashboard)
- Navigate to your project Settings tab
- Find the "API Keys" section
- Click "Generate API Key" or "Create New Key"
- Copy the key immediately (format:
redir_live_...) - Store it securely - you won't be able to see it again
Time: ~2 minutes
API keys are shown only once. If you lose your key, you'll need to generate a new one.
Step 4: Deploy Configuration (via Dashboard)
- Look for the "Deploy" button in your project (usually at the top right)
- Click "Deploy" to push your configuration to the edge
- Wait for deployment status to show "Live" (typically 60-90 seconds)
- Your redirects are now active globally at edge locations
Time: ~2 minutes
Deployments propagate to 300+ edge locations worldwide. First deploy may take up to 90 seconds.
Step 5: Test API Query (via Terminal)
Now test your redirect lookup with a cURL command. Replace the placeholder values:
YOUR_PROJECT_ID- Your project ID from Step 1YOUR_API_KEY- The API key you generated in Step 3
curl -X GET "https://api.3xx.app/v1/lookup?project=YOUR_PROJECT_ID&path=/blog/old-post" \
-H "X-API-Key: YOUR_API_KEY"Expected Response (200 OK):
{
"destination": "/articles/new-post",
"statusCode": 301,
"matchType": "exact"
}If the path has no redirect configured, you'll receive a 204 No Content response with an empty body.
Time: ~5 minutes
Success! You've completed your first redirect lookup. The API responded from the nearest edge location with sub-50ms latency.
Step 6: Integrate into Your Application
Choose your programming language and follow the integration guide:
- cURL Examples - Command-line and shell scripts
- JavaScript Examples - Node.js and browser with fetch API
- Python Examples - Python with requests library
Each guide includes copy-paste ready code examples with error handling.
Time: ~10-15 minutes
Next Steps
Now that you have the API working, explore these resources:
- API Reference - Complete endpoint documentation with all parameters
- Lookup Endpoint - Detailed lookup endpoint reference
- Export Endpoint - Download configs in nginx, HAProxy, CSV formats
- Error Reference - All error codes with resolution steps
Total Time: ~30 minutes
You now have a working redirect lookup API integrated into your application!