Getting started overview

Getting started with the 1pt API involves a sequence of standard steps: account creation, API key retrieval, and making an initial API call. This process allows developers to integrate 1pt's URL shortening capabilities into applications for personal use or small projects. The API is designed to be straightforward, primarily using HTTP requests for operations such as creating custom short links and accessing basic link analytics. Developers interact with the API endpoints by including their unique API key for authentication.

The 1pt platform provides a free tier that supports up to 10,000 links per month, suitable for initial exploration and small-scale applications. Paid plans, starting at $5/month, enhance capabilities through increased link limits and advanced features. The API reference documentation provides detailed information on available endpoints and request formats.

This guide will walk through the essential steps to make your first successful API request, focusing on the core functionality of URL shortening.

Quick Start Reference

Step What to Do Where
1. Sign Up Create a 1pt account. 1pt homepage
2. Get API Key Locate and copy your unique API key from the dashboard. 1pt API documentation portal
3. Make Request Construct and execute an API call using cURL. Command line or API client
4. Verify Response Check the API response for the shortened URL. Command line or API client

Create an account and get keys

Access to the 1pt API requires an authenticated account. The first step is to register on the 1pt platform. This process typically involves providing an email address and creating a password.

  1. Visit the 1pt Website: Navigate to the 1pt homepage.
  2. Sign Up: Look for a 'Sign Up' or 'Register' option. Follow the prompts to create your account. This usually involves entering an email address and setting a password. Account creation may require email verification.
  3. Access Dashboard: Once registered and logged in, you will be directed to your 1pt dashboard. This interface is where you manage your links, view analytics, and access API-related settings.
  4. Retrieve API Key: Within your dashboard or account settings, there will be a section dedicated to API access. The 1pt API uses an API key for authentication. This key is a unique string that identifies your account and authorizes your API requests. Copy this key, as it will be required for all subsequent API interactions. The 1pt API documentation portal provides specific instructions on where to find your key. API keys should be treated as sensitive credentials and stored securely to prevent unauthorized access to your account and services.

Your first request

Once you have your API key, you can make your first API call to shorten a URL. The 1pt API primarily uses HTTP POST requests for creating shortened links. This example will use cURL, a common command-line tool for making web requests, which is available on most Unix-like operating systems and can be installed on Windows.

API Endpoint and Method

  • Endpoint: https://1pt.co/api/v1/shorten
  • Method: POST

Request Headers

Your request must include:

  • Content-Type: application/json: Specifies that the request body is in JSON format.
  • Authorization: Bearer YOUR_API_KEY: Authenticates your request using the API key obtained from your dashboard. Replace YOUR_API_KEY with your actual key. This is a common method for API authentication, often referred to as Bearer Token authentication, as described in RFC 6750 for OAuth 2.0 Bearer Token Usage.

Request Body

The request body should be a JSON object containing the URL you wish to shorten. For example:


{
  "longUrl": "https://example.com/very/long/url/that/needs/to/be/shortened"
}

cURL Example

Construct your cURL command using your API key and the longUrl you want to shorten. Replace <YOUR_API_KEY> with your actual 1pt API key.


curl -X POST \
  https://1pt.co/api/v1/shorten \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -d '{"longUrl": "https://developers.google.com/maps/documentation/geocoding/overview"}'

This command sends a POST request to the /shorten endpoint with the specified headers and JSON body. In this example, we're shortening a sample URL from the Google Maps Geocoding API overview.

Expected Response

A successful request will return an HTTP 200 OK status code and a JSON response containing the shortened URL, among other details.


{
  "id": "unique_link_id",
  "shortUrl": "https://1pt.co/abcde",
  "longUrl": "https://developers.google.com/maps/documentation/geocoding/overview",
  "createdAt": "2026-05-29T12:00:00Z"
}

The shortUrl field will contain the new, shortened URL generated by 1pt. You can then use this URL in your applications or share it as needed.

Common next steps

After successfully shortening your first URL, several common next steps can enhance your use of the 1pt API:

  1. Explore Custom Short Links: The 1pt API often supports creating custom short links, allowing you to specify a readable alias instead of a randomly generated one. This feature can be beneficial for branding and memorability. Consult the 1pt API reference for details on parameters that enable custom slugs.
  2. Implement Link Analytics: 1pt provides basic analytics for your shortened links, tracking clicks and other metrics. Explore the API endpoints designed to retrieve this data to gain insights into your link performance. This often involves querying an endpoint with the ID of your shortened link.
  3. Integrate into an Application: Move beyond cURL and integrate the API calls into your preferred programming language or framework. Most languages have HTTP client libraries (e.g., requests in Python, axios in JavaScript) that simplify making API requests and handling responses.
  4. Error Handling: Implement robust error handling in your code. The API will return different HTTP status codes and error messages for invalid requests, missing parameters, or authentication failures. Properly handling these errors ensures your application remains stable and provides informative feedback to users.
  5. QR Code Generation: If your 1pt plan includes it, explore the API's capabilities for generating QR codes associated with your short links. This can be useful for physical marketing materials or easy mobile access.
  6. Review Pricing and Features: As your usage grows, review the 1pt pricing page to understand the different tiers and features available. This helps in scaling your usage and accessing more advanced capabilities if needed.

Troubleshooting the first call

When making your first API call, you might encounter issues. Here are some common problems and their solutions:

  • Authentication Failure (HTTP 401 Unauthorized):
    • Issue: This usually means your API key is missing, incorrect, or expired.
    • Solution: Double-check that you have included the Authorization: Bearer <YOUR_API_KEY> header in your request and that <YOUR_API_KEY> is the exact key from your 1pt dashboard. Ensure there are no leading or trailing spaces.
  • Bad Request (HTTP 400 Bad Request):
    • Issue: The API couldn't understand your request, often due to malformed JSON or missing required parameters.
    • Solution: Verify that your JSON payload is correctly formatted (e.g., all quotes are present, commas are in the right places). Ensure the longUrl parameter is present and contains a valid URL. Check the Content-Type: application/json header is correctly set.
  • Method Not Allowed (HTTP 405 Method Not Allowed):
    • Issue: You're using the wrong HTTP method for the endpoint (e.g., GET instead of POST for shortening).
    • Solution: For shortening URLs, ensure you are using the POST method. Refer to the 1pt API documentation for the correct HTTP method for each endpoint.
  • Server Error (HTTP 5xx):
    • Issue: These errors indicate a problem on the 1pt server side.
    • Solution: These are usually temporary. Wait a few minutes and retry your request. If the problem persists, check the 1pt status page (if available) or contact 1pt support.
  • Network Issues:
    • Issue: Your request might not be reaching the 1pt servers due to local network problems or firewalls.
    • Solution: Check your internet connection. If you're on a corporate network, ensure no firewall rules are blocking outgoing HTTP/HTTPS requests to 1pt.co.
  • Incorrect Endpoint URL:
    • Issue: You might be making a request to an incorrect or mistyped API endpoint.
    • Solution: Verify that the URL https://1pt.co/api/v1/shorten is precisely what you are using in your cURL command.