Skip to main content
This quickstart guide will walk you through making your first API call to the taap.it API.

Prerequisites

Before you begin, you’ll need:
  • A taap.it account
  • An API key (created through the web dashboard)
  • A tool to make HTTP requests (curl, Postman, or your preferred client)

Step 1: Create an API Key

1

Log into taap.it Dashboard

Visit www.taap.it and log into your account.
2

Navigate to API Settings

Go to your user settings and find the “API Keys” section.
3

Generate New Key

Click “Create API Key” and give it a descriptive name. Copy the generated key immediately.
API keys are only shown once during creation. Make sure to copy and store them securely.
Your API key will look like this: taapit_abc123def456ghi789jkl012mno345pqr678stu901vwx234yz

Step 2: Make Your First Request

Let’s start by listing your existing links to verify your API key is working:
cURL
curl -X GET 'https://api.taap.it/v1/links' \
  -H 'Authorization: Bearer taapit_your_api_key_here' \
  -H 'Content-Type: application/json'
Response:
{
  "items": [],
  "page": 1,
  "page_size": 20,
  "has_next": false
}
Now let’s create a shortened link:
cURL
curl -X POST 'https://api.taap.it/v1/links' \
  -H 'Authorization: Bearer taapit_your_api_key_here' \
  -H 'Content-Type: application/json' \
  -d '{
    "original_url": "https://example.com/very-long-url-that-needs-shortening",
    "custom_code": "my-custom-link"
  }'
Response:
{
  "id": "link_987654321",
  "original_url": "https://example.com/very-long-url-that-needs-shortening",
  "short_url": "https://taap.it/my-custom-link",
  "code": "my-custom-link",
  "created_at": "2024-01-15T10:35:00Z",
  "updated_at": "2024-01-15T10:35:00Z",
  "click_count": 0,
  "is_active": true
}
Let’s check the analytics for your newly created link:
cURL
curl -X GET 'https://api.taap.it/v1/stats/links/link_987654321' \
  -H 'Authorization: Bearer taapit_your_api_key_here' \
  -H 'Content-Type: application/json'
Response:
[
  {
    "link_id": "link_987654321",
    "click_date": "2024-01-15",
    "total_clicks": 0,
    "unique_visitors": 0,
    "country_stats": {},
    "device_stats": {},
    "browser_stats": {},
    "scans_only": 0
  }
]

Next Steps

Common Patterns

Error Handling

Always check for errors in API responses:
JavaScript Example
const response = await fetch('https://api.taap.it/v1/links', {
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  }
});

if (!response.ok) {
  const error = await response.json();
  console.error('API Error:', error.detail);
  return;
}

const data = await response.json();
console.log('Success:', data);

Rate Limit Handling

Handle rate limits gracefully:
JavaScript Example
async function makeRequest(url, options) {
  const response = await fetch(url, options);
  
  if (response.status === 429) {
    const retryAfter = response.headers.get('Retry-After');
    console.log(`Rate limited. Retry after ${retryAfter} seconds`);
    await new Promise(resolve => setTimeout(resolve, retryAfter * 1000));
    return makeRequest(url, options); // Retry
  }
  
  return response;
}

Need Help?

  • Verify your API key is correct and active
  • Ensure you’re using the Bearer prefix in the Authorization header
  • Check that your API key hasn’t expired
  • Implement exponential backoff for retries
  • Monitor the X-RateLimit-Remaining header
  • Consider caching responses to reduce API calls
  • 401 Unauthorized: Invalid or missing API key
  • 403 Forbidden: Insufficient permissions for the requested resource
  • 404 Not Found: Resource doesn’t exist or you don’t have access
  • 409 Conflict: Resource already exists (e.g., duplicate custom code)

Ready to build?

Explore our complete API reference to unlock the full power of taap.it.