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
- Log in to the LinkShark Dashboard .
- Navigate to General → Api Key in the sidebar.
- Click Generate Key and confirm.
- Copy the key and store it securely.
For detailed instructions with screenshots, see the Obtaining Your API Key guide.
Step 2 — Create Your First Short Link
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
}Step 3 — Verify Your Link
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.
Step 4 — Share Your Link
Use the smartLink value from the response to share your shortened URL:
https://lnk.shark/my-first-linkVisitors who open this URL will be redirected to https://example.com/my-long-article-url.
What’s Next?
- Deep links — Add
iosDeeplinkUrlandandroidDeeplinkUrlto route mobile users directly into your app. - Bulk creation — Use the
/link/external/v1/bulkSaveendpoint 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