{"openapi":"3.0.3","info":{"title":"Pandan Link Shortener API","description":"Shorten URLs and track clicks with analytics. Free tier: 50 links, no API key required.","version":"1.0.0","contact":{"name":"Pandan","url":"https://s.pandan.is"}},"servers":[{"url":"https://s.pandan.is","description":"Production"}],"paths":{"/v1/shorten":{"post":{"summary":"Shorten a URL","description":"Creates a short link and returns the shortened URL with analytics tracking.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"The URL to shorten","example":"https://example.com/very/long/path"},"slug":{"type":"string","description":"Custom slug (optional, auto-generated if not provided)","example":"my-link"},"title":{"type":"string","description":"Optional title for the link"}}}}}},"responses":{"201":{"description":"Link created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"short_url":{"type":"string","example":"https://s.pandan.is/abc123"},"slug":{"type":"string","example":"abc123"},"original_url":{"type":"string"},"analytics_url":{"type":"string","example":"https://s.pandan.is/abc123/stats"}}}}}},"400":{"description":"Invalid URL"},"429":{"description":"Rate limit exceeded"}}}},"/{slug}":{"get":{"summary":"Redirect to original URL","description":"Redirects to the original URL and tracks the click.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to original URL"},"404":{"description":"Link not found"}}}},"/{slug}/stats":{"get":{"summary":"Get link analytics","description":"Returns click statistics for a shortened link.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Link statistics","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string"},"total_clicks":{"type":"integer"},"clicks":{"type":"array","items":{"type":"object","properties":{"clicked_at":{"type":"string"},"referer":{"type":"string"},"country":{"type":"string"}}}}}}}}}}}}},"components":{"securitySchemes":{"ApiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}