Skip to Content

Quick Start

Get up and running with the LinkShark API in under 5 minutes. This guide walks you through creating your first short link end-to-end.


Step 1 — Get Your API Key

  1. Log in to the LinkShark Dashboard .
  2. Navigate to General → Api Key in the sidebar.
  3. Click Generate Key and confirm.
  4. Copy the key and store it securely.

For detailed instructions with screenshots, see the Obtaining Your API Key guide.


Replace your_api_key_here with your actual API key:

curl -X POST https://api.linkshark.xyz/link/external/v1/save \ -H "X-API-KEY: your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/my-long-article-url", "shortCode": "my-first-link", "title": "My First LinkShark Link" }'

Expected Response:

{ "response": { "id": "abc12345-6789-...", "url": "https://example.com/my-long-article-url", "shortCode": "my-first-link", "smartLink": "https://lnk.shark/my-first-link", "title": "My First LinkShark Link", "isActive": true, "totalClicks": 0, "createdAt": "2025-01-15T10:30:00", "updatedAt": "2025-01-15T10:30:00" }, "error": null }

Retrieve your link to confirm it was created:

curl -X GET "https://api.linkshark.xyz/link/external/v1/?page=0&size=10" \ -H "X-API-KEY: your_api_key_here"

You should see your link in the content array of the paginated response.


Use the smartLink value from the response to share your shortened URL:

https://lnk.shark/my-first-link

Visitors who open this URL will be redirected to https://example.com/my-long-article-url.


What’s Next?

  • Deep links — Add iosDeeplinkUrl and androidDeeplinkUrl to route mobile users directly into your app.
  • Bulk creation — Use the /link/external/v1/bulkSave endpoint to create up to 30 links in a single request.
  • Filtering — Use the Query DSL to search your links by title, tags, click count, and more.
  • Error handling — Review the API Errors page to handle edge cases gracefully.
Last updated on