LinkSnap

Getting Started

Create your account and capture your first screenshot

Getting Started

This guide will help you set up LinkSnap and capture your first screenshot in just a few minutes.

Step 1: Create an Account

  1. Go to console.linksnap.dev
  2. Sign up with your email or GitHub account
  3. Verify your email address

Step 2: Get Your API Key

  1. Navigate to API Keys in the sidebar
  2. Click Create API Key
  3. Give your key a name (e.g., "Development")
  4. Copy your API key - you'll only see it once!

Store your API key securely. Never expose it in client-side code or public repositories.

Step 3: Make Your First Request

Use curl or your favorite HTTP client to capture a screenshot:

curl -X POST https://api.linksnap.dev/v1/screenshots \
  -H "Authorization: Bearer lk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com",
    "format": "png",
    "viewport": {
      "width": 1920,
      "height": 1080
    }
  }'

Response

{
  "success": true,
  "data": {
    "id": "ss_abc123",
    "url": "https://cdn.linksnap.dev/screenshots/ss_abc123.png",
    "format": "png",
    "width": 1920,
    "height": 1080,
    "createdAt": "2024-01-15T10:30:00Z"
  }
}

Step 4: Use the Screenshot

The response includes a CDN URL where your screenshot is hosted. You can:

  • Embed it directly in your application
  • Download it for further processing
  • Store the URL in your database for later use

Next Steps

Code Examples

Node.js

const response = await fetch('https://api.linksnap.dev/v1/screenshots', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.LINKSNAP_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    url: 'https://example.com',
    format: 'png',
  }),
});

const data = await response.json();
console.log(data.data.url);

Python

import requests

response = requests.post(
    'https://api.linksnap.dev/v1/screenshots',
    headers={
        'Authorization': f'Bearer {API_KEY}',
        'Content-Type': 'application/json',
    },
    json={
        'url': 'https://example.com',
        'format': 'png',
    }
)

data = response.json()
print(data['data']['url'])

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func main() {
    payload := map[string]interface{}{
        "url":    "https://example.com",
        "format": "png",
    }

    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST", "https://api.linksnap.dev/v1/screenshots", bytes.NewBuffer(body))
    req.Header.Set("Authorization", "Bearer "+apiKey)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, _ := client.Do(req)
    defer resp.Body.Close()
}