Documentation

Quick Start Guide: Using APIs

Our REST API is structured to be intuitive and easy to use, supporting standard HTTP methods and returning data in JSON format for maximum compatibility and ease of parsing. In the following sections, you'll find a complete breakdown of available endpoints, request methods, expected parameters, and sample responses to help you get started quickly and efficiently.

1

What is an API?

An API (Application Programming Interface) is a way for software systems to communicate with each other. Instead of using a user interface (like a website), APIs use structured data requests — usually over HTTP — to access or submit information. APIs typically respond with JSON (JavaScript Object Notation), a lightweight format for exchanging data between systems.

For example, instead of asking a human to calculate what 2:00 PM Eastern Time is in London, you can send that to an API and get back the answer instantly.

2

What is an API Key?

Think of an API key as your personal access badge — it identifies who you are and what you're allowed to do. Most APIs (including Datpaq's) require you to include this key in your requests so they can track usage and protect the system from abuse.

Datpaq APIs normally expect your key in the x-api-key header. Some tooling-specific integrations may also support an api_key query parameter, but the dashboard examples use the header by default.

3

What are Rate Limits?

Rate limiting protects APIs from being overwhelmed by too many requests. It sets boundaries like:

  • Max requests per second/minute/hour
  • Max requests per IP or API key

When you exceed a limit, the API will typically respond with:

  • 429 Too Many Requests HTTP status code
  • A message like { "error": "Rate limit exceeded. Try again in 60 seconds." }

Best practices:

  • Cache responses when possible
  • Avoid polling too frequently
  • Handle 429 errors gracefully (e.g. back off and retry later)
4

Making Your First API Request

There are multiple ways to call an API depending on your workflow.

Below are examples using cURL, Postman, and JavaScript fetch.

Example API: convert-time

This endpoint converts a datetime string from one timezone to another.

GET https://datpaq.com/api/v1/convert-time

cURL Example:

Code
1curl -X GET "https://datpaq.com/api/v1/convert-time?sourceTime=2025-11-11T14:00:00&sourceZone=America/New_York&targetZone=Europe/London" \2-H "Accept: application/json" \3-H "x-api-key: YOUR_API_KEY"

Postman Example:

  1. Open Postman.
  2. Set method to GET and URL to https://datpaq.com/api/v1/convert-time
  3. Under Headers, add:
    • Accept: application/json
    • x-api-key: YOUR_API_KEY
  4. Under Params, add the following query values:
Code
1{2  "sourceTime": "2025-11-11T14:00:00",3  "sourceZone": "America/New_York",4  "targetZone": "Europe/London"5}

JavaScript (fetch) Example

Code
1const url = new URL("https://datpaq.com/api/v1/convert-time");2url.searchParams.set("sourceTime", "2025-11-11T14:00:00");3url.searchParams.set("sourceZone", "America/New_York");4url.searchParams.set("targetZone", "Europe/London");5 6fetch(url, {7  method: "GET",8  headers: {9    "Accept": "application/json",10    "x-api-key": "YOUR_API_KEY"11  }12})13  .then(response => response.json())14  .then(data => console.log("Converted time:", data))15  .catch(error => console.error("Error:", error));
5

What Happens Next?

Once you send your request, you'll receive a JSON response like:

Code
1{2  "sourceTime": "2025-11-11T14:00:00",3  "sourceZone": "America/New_York",4  "targetZone": "Europe/London",5  "convertedTime": "2025-11-11T19:00:00Z"6}

You can now integrate this result into your app, workflow, or analysis pipeline.

Last Updated:  March, 2026