# 開発者およびエージェント向けドキュメント

> Lee Sugano Digital Solutions の公開API、OpenAPI仕様、Markdownコンテンツネゴシエーション、MCPサーバー。

このページでは、leesugano.com がプログラムから利用できる形で公開しているすべて（公開コンテンツAPI、それを記述するOpenAPI仕様、全ページのMarkdown表現、MCPサーバー）を説明します。

APIキーも登録も不要です。エンドポイントは公開されており、IP単位でレート制限があり、エラーを含むすべてのレスポンスはJSONです。

## クイックスタート

ほとんどの用途は3つの呼び出しでカバーできます。仕様の取得、公開記事の一覧、任意のページのMarkdown取得です。

```bash
# OpenAPI
curl -s https://leesugano.com/openapi.json

# listPublishedPosts
curl -s "https://leesugano.com/api/posts?limit=5&locale=en"

# Markdown
curl -s -H "Accept: text/markdown" https://leesugano.com/blog
```

## 公開エンドポイント

以下のエンドポイントはすべて匿名リクエストを受け付けます。リクエストとレスポンスの完全なスキーマはOpenAPI仕様にあります。

| メソッド | パス | operationId | 内容 |
| --- | --- | --- | --- |
| GET | `/api/posts` | `listPublishedPosts` | List published blog posts |
| GET | `/api/categories` | `listCategories` | List blog categories |
| GET | `/api/tags` | `listTags` | List blog tags |
| GET | `/api/posts/{id}/reactions` | `getPostReactions` | Read a post's reactions |
| POST | `/api/posts/{id}/reactions` | `reactToPost` | Add, switch or remove a reaction |
| POST | `/api/newsletter` | `subscribeToNewsletter` | Subscribe an email to the newsletter |
| POST | `/api/start/recommend` | `recommendSolution` | Recommend a solution from a business profile |
| GET | `/api/og` | `renderOpenGraphImage` | Render a 1200x630 Open Graph image |

[OpenAPI JSON](https://leesugano.com/openapi.json) · [OpenAPI YAML](https://leesugano.com/openapi.yaml)

## 同じURLでMarkdown

すべての公開ページは、同じURLからブラウザにはHTMLを、エージェントにはMarkdownを返します。判定は acceptmarkdown.com の規約に従い Accept ヘッダーで行われます。

レスポンスには Vary: Accept が付くため、CDNは2つの表現を別々にキャッシュします。明示的なURLが必要な場合はパスに .md を付けてください。

```bash
curl -sI -H "Accept: text/markdown" https://leesugano.com/blog
curl -s https://leesugano.com/blog.md
```

## エラー形式

エラーがHTMLで返ることはありません。すべての失敗は以下のフィールドを持つJSONオブジェクトと、対応するHTTPステータスで返されます。

変わる可能性のある error のテキストではなく、安定した code で分岐してください。

| フィールド | 意味 |
| --- | --- |
| `error` | 人間向けのメッセージ。予告なく変わることがあります。 |
| `code` | SCREAMING_SNAKE_CASE の安定したコード。ロジックにはこれを使ってください。 |
| `requestId` | リクエスト識別子。x-request-id ヘッダーにも入ります。 |
| `details` | バリデーションの詳細。開発環境でのみ返ります。 |

## レート制限

7 個の公開エンドポイントは、60 秒のウィンドウでIP単位のレート制限が適用されます。

すべてのレスポンスに RateLimit-Limit、RateLimit-Remaining、RateLimit-Reset が付きます。制限を超えると Retry-After（秒）付きの 429 が返ります。ループで再試行せず、これらのヘッダーで自己制御してください。

| エンドポイント | 上限 |
| --- | --- |
| `GET /api/posts` | 60 リクエスト/分（IP単位） / 60s |
| `GET /api/categories` | 60 リクエスト/分（IP単位） / 60s |
| `GET /api/tags` | 60 リクエスト/分（IP単位） / 60s |
| `GET /api/posts/{id}/reactions` | 60 リクエスト/分（IP単位） / 60s |
| `POST /api/posts/{id}/reactions` | 20 リクエスト/分（IP単位） / 60s |
| `POST /api/newsletter` | 10 リクエスト/分（IP単位） / 60s |
| `POST /api/start/recommend` | 8 リクエスト/分（IP単位） / 60s |

## MCPサーバー

https://mcp.leesugano.com で Model Context Protocol サーバーを Streamable HTTP トランスポートで運用しています。

OAuthで保護されており、ツール一覧は匿名ではなく認可後に利用できます。

## AIエージェント向け

運用上の指示（どの案件に適し、どれに適さないか、各意図に対する具体的な呼び出し方）は /agents.md にあります。

会社に関する正規の事実は /llms.txt に、拡張版は /llms-full.txt にあります。

- [agents.md](https://leesugano.com/agents.md)
- [llms.txt](https://leesugano.com/llms.txt)
- [llms-full.txt](https://leesugano.com/llms-full.txt)

---

- HTML版: https://leesugano.com/ja/docs
- Lee Sugano Digital Solutions - contact@leesugano.com

## 次に見る場所

- [ホーム](https://leesugano.com/ja)
- [会社概要](https://leesugano.com/ja/about)
- [サービス](https://leesugano.com/ja/servicos)
- [実績](https://leesugano.com/ja/portfolio)
- [ブログ](https://leesugano.com/ja/blog)
- [よくある質問](https://leesugano.com/ja/faq)
- [開発者およびエージェント向けドキュメント](https://leesugano.com/ja/docs)
- [お問い合わせ](https://leesugano.com/ja/contact)
- [プライバシーポリシー](https://leesugano.com/ja/privacidade)
- [利用規約](https://leesugano.com/ja/termos)
- [特定商取引法に基づく表記](https://leesugano.com/ja/tokushoho)

## 他の言語

- [pt](https://leesugano.com/docs)
- [en](https://leesugano.com/en/docs)
- [es](https://leesugano.com/es/docs)

## 機械可読リソース

- [AI向けの正規サマリー (llms.txt)](https://leesugano.com/llms.txt)
- [エージェント向けの指示（どんなときに使うか）](https://leesugano.com/agents.md)
- [公開APIのOpenAPI仕様](https://leesugano.com/openapi.json)
- [開発者およびエージェント向けドキュメント](https://leesugano.com/ja/docs)
- [サイトマップ (XML)](https://leesugano.com/sitemap.xml)
- [ブログのRSSフィード](https://leesugano.com/feed.xml)
