ドキュメント

Thousand APIとは

Thousand APIは、AIエージェント向けのユーティリティMCPサーバーです。AIが推論で曖昧にしか処理できないことを、確実・高速に解決するツール群を提供します。

主な特徴:

  • MCPサーバーとして直接接続可能(Claude・Cursor対応)
  • REST APIとしても利用可能
  • リアルタイムデータ・確実な計算・副作用処理を提供
  • タイムゾーン・祝日・営業日など、推論に頼りがちな日時計算を確実に実行

アカウント登録

  1. 新規登録ページでメールアドレスとパスワードを入力
  2. アカウントが作成されダッシュボードに遷移
  3. 無料プランで即座に利用開始可能

APIキーの発行

  1. ダッシュボードにアクセス
  2. 「APIキーを発行する」をクリック
  3. キーの名前を入力(例: "Cursor用"・"本番用")
  4. 発行されたAPIキーをコピー(この画面でのみ平文が表示されます)

Claude Desktop

claude_desktop_config.jsonに以下を追加してください。

設定ファイルの場所:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "thousand-api": {
      "url": "https://mcp.thousand-api.com/mcp",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}

Cursor

Cursorの設定(Settings > MCP)に以下を追加してください。

{
  "mcpServers": {
    "thousand-api": {
      "url": "https://mcp.thousand-api.com/mcp",
      "headers": {
        "x-api-key": "YOUR_API_KEY"
      }
    }
  }
}

その他のMCPクライアント

Streamable HTTP transportに対応したMCPクライアントであれば接続できます。

  • URL: https://mcp.thousand-api.com/mcp
  • 認証: x-api-key ヘッダーにAPIキーを設定

認証

すべてのAPIリクエストにx-api-keyヘッダーが必要です。

curl https://api.thousand-api.com/v1/calendar/holidays \
  -H "x-api-key: YOUR_API_KEY"

レスポンスコード:

コード説明
200成功
401APIキーが無効または未指定
422バリデーションエラー
429レート制限超過
500サーバーエラー

エラーコード

エラーレスポンスは以下の形式で返されます。

{
  "error": "VALIDATION_ERROR",
  "message": "country must be one of: JP, US"
}

エラーコード一覧:

コード説明
VALIDATION_ERRORリクエストパラメータが不正
NOT_FOUNDリソースが見つからない
INTERNAL_ERRORサーバー内部エラー

Calendar

複数国の祝日判定・営業日計算に加え、タイムゾーン間の日時変換とスケジュール計算(DST自動考慮)を提供します。

MCPツール名: get_holidays / is_holiday / add_business_days / calc_schedule

GET /v1/calendar/holidays

指定した国・年の祝日一覧を取得します。

パラメータ:

パラメータ必須説明
countrystring国コード(JP / US)
yearinteger-対象年(省略時は当年)

リクエスト例:

curl "https://api.thousand-api.com/v1/calendar/holidays?country=JP&year=2026" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "country": "JP",
  "year": 2026,
  "count": 16,
  "holidays": [
    { "date": "2026-01-01", "name": "元日" },
    { "date": "2026-01-12", "name": "成人の日" }
  ]
}

GET /v1/calendar/is-holiday

指定した日付が祝日かどうかを判定します。

パラメータ:

パラメータ必須説明
countrystring国コード(JP / US)
datestring判定する日付(YYYY-MM-DD)

リクエスト例:

curl "https://api.thousand-api.com/v1/calendar/is-holiday?country=JP&date=2026-01-01" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "date": "2026-01-01",
  "country": "JP",
  "is_holiday": true,
  "name": "元日"
}

GET /v1/calendar/business-days

指定した日付からN営業日後(または前)の日付を計算します。

パラメータ:

パラメータ必須説明
countrystring国コード(JP / US)
fromstring起算日(YYYY-MM-DD)
daysinteger追加する営業日数(負の値で過去方向)

リクエスト例:

curl "https://api.thousand-api.com/v1/calendar/business-days?country=JP&from=2026-01-01&days=5" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "from": "2026-01-01",
  "days": 5,
  "country": "JP",
  "result": "2026-01-08"
}

GET /v1/calendar/schedule-calc

タイムゾーン間の日時変換とスケジュール計算を行います。サマータイム(DST)を自動考慮し、営業日・曜日指定にも対応します。

パラメータ:

パラメータ必須説明
base_timestring基点日時(ISO 8601。Z/オフセット付き、または from_timezone のローカル時刻)
from_timezonestring基点タイムゾーン(IANA。例: Asia/Tokyo)
to_timezonestring変換先タイムゾーン(IANA。例: America/New_York)
operationstringadd_hours / next_business_day / next_weekday
valuestring-時間数・営業日数・曜日名(Thursday 等)
countrystring-next_business_day 時の祝日基準国(JP / US)
at_timestring-next_weekday 時の時刻(HH:MM、from_timezone 基準)

リクエスト例:

curl "https://api.thousand-api.com/v1/calendar/schedule-calc?base_time=2026-05-21T09:00:00&from_timezone=America/New_York&to_timezone=Asia/Tokyo&operation=next_business_day&value=1&country=US" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "input": {
    "base_time": "2026-05-21T09:00:00-04:00",
    "from_timezone": "America/New_York",
    "to_timezone": "Asia/Tokyo",
    "operation": "next_business_day",
    "value": "1",
    "country": "US"
  },
  "result": {
    "target_time_source_tz": "2026-05-22T09:00:00-04:00",
    "target_time_dest_tz": "2026-05-22T22:00:00+09:00",
    "is_dst": false,
    "formatted": "Friday, May 22, 2026 at 10:00 PM GMT+9"
  }
}

Scraper

URLのメタ情報・OGP情報を取得します。

MCPツール名: get_page_meta

GET /v1/scraper/meta

パラメータ:

パラメータ必須説明
urlstring情報を取得するURL(http/httpsのみ)

リクエスト例:

curl "https://api.thousand-api.com/v1/scraper/meta?url=https://example.com" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "url": "https://example.com",
  "title": "Example Domain",
  "description": "This domain is for use in illustrative examples.",
  "favicon": "https://example.com/favicon.ico",
  "ogp": {
    "title": null,
    "description": null,
    "image": null,
    "url": null,
    "site_name": null,
    "type": null
  },
  "canonical": "https://example.com/"
}

ExchangeRate

リアルタイムの為替レートと金額換算を返します。

MCPツール名: get_exchange_rate

GET /v1/exchangerate

パラメータ:

パラメータ必須説明
fromstring変換元通貨コード(例: JPY)
tostring変換先通貨コード(例: USD)
amountnumber-換算する金額(省略時は1)

リクエスト例:

curl "https://api.thousand-api.com/v1/exchangerate?from=JPY&to=USD&amount=1000" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "from": "JPY",
  "to": "USD",
  "rate": 0.0067,
  "amount": 1000,
  "converted": 6.7,
  "timestamp": "2026-05-20T00:00:00.000Z"
}

Distance

2地点間の距離を計算します。

MCPツール名: calculate_distance

GET /v1/distance

パラメータ:

パラメータ必須説明
p1string地点1の緯度,経度(例: 35.681236,139.767125)
p2string地点2の緯度,経度(例: 34.702485,135.495951)

リクエスト例:

curl "https://api.thousand-api.com/v1/distance?p1=35.681236,139.767125&p2=34.702485,135.495951" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "p1": { "lat": 35.681236, "lon": 139.767125 },
  "p2": { "lat": 34.702485, "lon": 135.495951 },
  "distance_km": 402.3
}

QRCode

テキストやURLからQRコードを生成します。

MCPツール名: generate_qrcode_url

GET /v1/qrcode

パラメータ:

パラメータ必須説明
datastringQRコードに埋め込むテキストまたはURL
sizeinteger-画像サイズpx(75〜1000、デフォルト300)
formatstring-出力形式(png / svg、デフォルトpng)

リクエスト例:

curl "https://api.thousand-api.com/v1/qrcode?data=https://example.com&size=300" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス:

PNG画像またはSVGデータをバイナリで返します。

IPLookup

IPアドレスの地理情報(国・地域・都市・緯度経度)を取得します。

MCPツール名: get_ip_info

GET /v1/iplookup

パラメータ:

パラメータ必須説明
addressstring-検索するIPアドレス(省略時はリクエスト元のIP)

リクエスト例:

curl "https://api.thousand-api.com/v1/iplookup?address=8.8.8.8" \
  -H "x-api-key: YOUR_API_KEY"

レスポンス例:

{
  "is_valid": true,
  "address": "8.8.8.8",
  "country": "United States",
  "country_code": "US",
  "region": "California",
  "city": "Mountain View",
  "zip": "94043",
  "lat": 37.4223,
  "lon": -122.0847
}