Quickstart Guide
Create your first Shortyy link in under 2 minutes using cURL, TypeScript SDK, or Python.
Quickstart Guide
Get up and running with Shortyy in less than 2 minutes. Follow these four quick steps to provision credentials and create your first production short link.
1. Obtain an API Key
Before making requests to the Shortyy REST API, generate a live API key with links:write scope:
▪
Navigate to the [API Keys Dashboard](/developers/keys).
▪
Click Create API Key.
▪
Name your key (e.g.
production-ci) and select your desired scopes:▪
links:write (required to shorten URLs)▪
links:read (required to list and retrieve links)▪
Copy your key immediately. It begins with
sh_live_ and is only shown once.bash
export SHORTYY_API_KEY="sh_live_your_48_hex_character_key_here"
export SHORTYY_API_URL="https://api.shortyy.com/v1"2. Create Your First Link
Using cURL
bash
curl -X POST "https://api.shortyy.com/v1/links" \
-H "Authorization: Bearer $SHORTYY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://github.com/fastify/fastify",
"expires_in": "2h"
}'Using the Official TypeScript SDK
bash
pnpm add @g/shortyytypescript
import { createShortyy } from '@g/shortyy';
const shortyy = createShortyy({
apiKey: process.env.SHORTYY_API_KEY!,
});
const link = await shortyy.links.create({
url: 'https://github.com/fastify/fastify',
expiresIn: '2h',
});
console.log('Short URL:', link.shortUrl);
console.log('Code:', link.code);Expected HTTP 201 Response
json
{
"link": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "a9x2bK",
"original_url": "https://github.com/fastify/fastify",
"short_url": "https://shortyy.com/a9x2bK",
"click_count": 0,
"expires_at": "2026-11-13T15:20:00.000Z",
"created_at": "2026-11-13T13:20:00.000Z"
}
}3. Verify Redirect Resolution
Test your short link by requesting it with cURL:
bash
curl -I https://shortyy.com/a9x2bKShortyy returns an immediate HTTP 307 Temporary Redirect or HTTP 301 Moved Permanently with the Location header pointing to your target destination URL.
4. View Click Analytics
Retrieve real-time metrics for your short code:
bash
curl -X GET "https://api.shortyy.com/v1/links/550e8400-e29b-41d4-a716-446655440000/analytics" \
-H "Authorization: Bearer $SHORTYY_API_KEY"