LinkBit

APIドキュメント

Create an API key in your account, then call LinkBit with x-api-key or Authorization: Bearer. Public docs never show your keys.

使い方

REST API

すべてのリクエストで x-api-key、または Authorization: Bearer slk_... を送ってください。

x-api-key: YOUR_API_KEY
Authorization: Bearer YOUR_API_KEY

リクエスト例

▸URLを1件短縮

短いリンクを1件作成。カスタムスラッグは任意(英数字とハイフン、1文字以上)。

curl -X POST https://linkbit.live/api/v1/links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"destination": "https://example.com/long-url", "slug": "my-link", "utm_source": "newsletter"}'
▸一括短縮(プラン上限 100 件)

一度に複数作成。失敗は errors に入り、成功分は作成されます。

curl -X POST https://linkbit.live/api/v1/links/bulk \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{"urls": [
    {"destination": "https://example.com/page1"},
    {"destination": "https://example.com/page2", "slug": "my-custom-slug"}
  ]}'
▸リンク一覧

このAPIキーの全リンクを新しい順で返します。shortUrl とクリック数を含みます。

curl https://linkbit.live/api/v1/links \
  -H "x-api-key: YOUR_API_KEY"
▸クリック統計

作成または一覧の id を使います。クリック、ユニーク、国、デバイス、リファラ、日次を返します。

curl "https://linkbit.live/api/v1/links/LINK_ID/stats?from=2026-01-01&to=2026-01-31" \
  -H "x-api-key: YOUR_API_KEY"
▸分析概要

アカウント全体の上位リンク、日次、国、デバイス、リファラ。

curl https://linkbit.live/api/v1/analytics \
  -H "x-api-key: YOUR_API_KEY"

フィールド

フィールド場所説明
destinationcreate / bulk必須。http(s) URL。別名: url
slugcreate / bulk任意。a-z、0-9、ハイフン。最短1文字。空白はハイフンになります。
utm_source … utm_contentcreate / bulk / CSVOptional. Stored on the destination URL. Existing utm_* query params are not overwritten. Hash fragments are kept.
urlsbulk bodyリンクの配列。別名: links
created / errorsbulk response成功行と項目ごとの検証エラー(index、message)。

認証エラーは401。不正な入力は400。存在しない統計idは404。