{
  "openapi": "3.1.0",
  "info": {
    "title": "Polyzon API",
    "version": "1.0.0",
    "description": "Polyzonのカタログで3Dモデルを検索し、モデル情報を取得するAPIです。アクセスには、polyzon.org/account/appsで発行した個人用トークンが必要です。"
  },
  "servers": [
    {
      "url": "https://api.polyzon.org"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "polyzon.org/account/appsの「アプリとAPI」で発行した個人用トークン（pzk_…）。"
      }
    }
  },
  "paths": {
    "/v1/search": {
      "get": {
        "operationId": "search",
        "summary": "モデルを検索",
        "description": "Polyzonのカタログを検索します。すべての対応サイトのモデルを対象に、フィルターとページ送りを使えます。取得できるのは先頭の2400件（page × size）までです。",
        "x-daily-quota": true,
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "検索クエリ（200文字以内）。対応している言語はロシア語と英語のみです。",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "dragon"
          },
          {
            "name": "page",
            "in": "query",
            "description": "ページ番号（1から始まります）。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 1
            }
          },
          {
            "name": "size",
            "in": "query",
            "description": "1ページあたりのモデル数。page × sizeは2400以下にしてください。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "並び順：relevant（関連度順）、popular（配布元サイトでの人気順）、newest（新着順）、likes、makes、downloads。",
            "schema": {
              "type": "string",
              "enum": [
                "relevant",
                "popular",
                "newest",
                "likes",
                "makes",
                "downloads"
              ],
              "default": "relevant"
            }
          },
          {
            "name": "free",
            "in": "query",
            "description": "無料のモデルのみに絞り込みます。",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "sources",
            "in": "query",
            "description": "対応サイト（カンマ区切り）：thingiverse, cults3d, printables, makerworld, 3dtoday, crealitycloud, myminifactory, thangs, youmagine, grabcad, sketchfab, threeding, nexprint, nasa, nih3d, smithsonian, pinshape, cgtrader, gambody, jewelmodel, makeronline, 3dexport。",
            "schema": {
              "type": "string"
            },
            "example": "thingiverse,printables"
          },
          {
            "name": "formats",
            "in": "query",
            "description": "ファイル形式（カンマ区切り）：stl、3mf、obj、step、scad、gcodeなど。",
            "schema": {
              "type": "string"
            },
            "example": "stl,3mf"
          },
          {
            "name": "license",
            "in": "query",
            "description": "ライセンス（カンマ区切り）：cc0, cc-by, cc-by-sa, cc-by-nd, cc-by-nc, cc-by-nc-sa, cc-by-nc-nd, gpl, lgpl, mit, bsd, private-use, commercial, custom, unknown。",
            "schema": {
              "type": "string"
            },
            "example": "cc0,cc-by"
          },
          {
            "name": "lang",
            "in": "query",
            "description": "タイトルとタグの言語：ruまたはen。元の言語がそれ以外の場合は、機械翻訳を返します。",
            "schema": {
              "type": "string",
              "enum": [
                "ru",
                "en"
              ],
              "default": "ru"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "検索結果の1ページ。`hasMore`は、2400件の範囲内に次のページがあるかどうかを示します。`partial`は、カタログの一部が応答せず、結果が不完全であることを示します。`stats.collects`はコレクションへの保存数で、サイトが保存数を集計していない場合はダウンロード数です。",
            "content": {
              "application/json": {
                "example": {
                  "query": "dragon",
                  "correctedQuery": null,
                  "didYouMean": null,
                  "total": 1873,
                  "totalRelation": "eq",
                  "page": 1,
                  "size": 20,
                  "hasMore": true,
                  "partial": false,
                  "items": [
                    {
                      "source": "thingiverse",
                      "id": "tv-1234567",
                      "title": "Articulated dragon (example)",
                      "url": "https://www.thingiverse.com/thing:1234567",
                      "thumbnail": "https://cdn.thingiverse.com/assets/dragon.jpg",
                      "creator": "example_maker",
                      "license": "cc-by-nc",
                      "price": {
                        "type": "free",
                        "value": 0,
                        "currency": null,
                        "display": "Free"
                      },
                      "formats": [
                        "stl"
                      ],
                      "tags": [
                        "dragon",
                        "toy"
                      ],
                      "stats": {
                        "likes": 51234,
                        "comments": 870,
                        "makes": 3120,
                        "collects": 61000
                      },
                      "publishedAt": "2021-01-17T10:21:00Z"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "パラメータが不正です（`bad_request`。対象は`param`フィールドに示されます）。または、要求したページが2400件の範囲を超えています（`page_too_deep`）。"
          },
          "401": {
            "description": "トークンがありません（`unauthorized`）。または、トークンが正しくないか取り消されています（`invalid_token`）。"
          },
          "403": {
            "description": "トークンの所有者がPolyzonの最新の利用規約に同意していません（`account_action_required`）。アカウントにログインして同意してください。または、このIPアドレスでは本日すでに他のアカウントが利用されています（`too_many_accounts`）。"
          },
          "429": {
            "description": "1分あたりのレート制限を超えたか（`rate_limited`）、1日のクォータ（`quota_exceeded`）またはIPアドレスの1日の上限（`address_quota_exceeded`）に達しました。`Retry-After`の秒数だけ待ってから再試行してください。"
          },
          "503": {
            "description": "カタログまたはトークンの検証が一時的に利用できません（`unavailable`）。しばらくしてから再試行してください。"
          }
        }
      }
    },
    "/v1/models/{source}/{id}": {
      "get": {
        "operationId": "getModel",
        "summary": "モデル情報を取得",
        "description": "サイトとIDを指定してモデルを取得します。どちらも、検索結果の各項目や、モデルページのアドレスpolyzon.org/model/{source}/{id}に含まれる値と同じです。画像のURLは、各サイト自身のCDNを指します。",
        "x-daily-quota": true,
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "description": "モデルの配布元サイト。",
            "schema": {
              "type": "string",
              "enum": [
                "thingiverse",
                "cults3d",
                "printables",
                "makerworld",
                "3dtoday",
                "crealitycloud",
                "myminifactory",
                "thangs",
                "youmagine",
                "grabcad",
                "sketchfab",
                "threeding",
                "nexprint",
                "nasa",
                "nih3d",
                "smithsonian",
                "pinshape",
                "cgtrader",
                "gambody",
                "jewelmodel",
                "makeronline",
                "3dexport"
              ]
            },
            "example": "thingiverse"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "サイト上のモデルID（Polyzonのプレフィックス付き）。例：tv-1234567。",
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "example": "tv-1234567"
          },
          {
            "name": "lang",
            "in": "query",
            "description": "タイトル、説明、タグの言語：ruまたはen。",
            "schema": {
              "type": "string",
              "enum": [
                "ru",
                "en"
              ],
              "default": "ru"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "モデル情報。`copies`には、他のサイトに掲載されている同じモデルが入ります。",
            "content": {
              "application/json": {
                "example": {
                  "source": "thingiverse",
                  "id": "tv-1234567",
                  "title": "Articulated dragon (example)",
                  "url": "https://www.thingiverse.com/thing:1234567",
                  "thumbnail": "https://cdn.thingiverse.com/assets/dragon.jpg",
                  "creator": "example_maker",
                  "license": {
                    "id": "cc-by-nc",
                    "raw": "Creative Commons - Attribution - Non-Commercial"
                  },
                  "price": {
                    "type": "free",
                    "value": 0,
                    "currency": null,
                    "display": "Free"
                  },
                  "formats": [
                    "stl"
                  ],
                  "tags": [
                    "dragon",
                    "toy"
                  ],
                  "stats": {
                    "likes": 51234,
                    "comments": 870,
                    "makes": 3120,
                    "collects": 61000,
                    "downloads": 410000,
                    "views": 990000
                  },
                  "publishedAt": "2021-01-17T10:21:00Z",
                  "description": "The dragon prints in one piece, no supports needed…",
                  "images": [
                    "https://cdn.thingiverse.com/assets/dragon.jpg"
                  ],
                  "creatorUrl": "https://www.thingiverse.com/example_maker",
                  "category": "Toys & Games",
                  "updatedAt": "2021-02-02T08:00:00Z",
                  "copies": [
                    {
                      "source": "printables",
                      "id": "pr-123456"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "トークンがありません（`unauthorized`）。または、トークンが正しくないか取り消されています（`invalid_token`）。"
          },
          "403": {
            "description": "トークンの所有者がPolyzonの最新の利用規約に同意していません（`account_action_required`）。アカウントにログインして同意してください。または、このIPアドレスでは本日すでに他のアカウントが利用されています（`too_many_accounts`）。"
          },
          "404": {
            "description": "モデルが見つかりません（`not_found`）。"
          },
          "410": {
            "description": "権利者の要請により、モデルは削除されました（`gone`）。お使いのサービス側でも削除してください。"
          },
          "429": {
            "description": "1分あたりのレート制限を超えたか（`rate_limited`）、1日のクォータ（`quota_exceeded`）またはIPアドレスの1日の上限（`address_quota_exceeded`）に達しました。`Retry-After`の秒数だけ待ってから再試行してください。"
          },
          "503": {
            "description": "カタログまたはトークンの検証が一時的に利用できません（`unavailable`）。しばらくしてから再試行してください。"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "getMe",
        "summary": "アカウントとトークンの情報を取得",
        "description": "リクエストに使用したトークンの所有者を返します。1日のクォータは消費しません。",
        "x-daily-quota": false,
        "parameters": [],
        "responses": {
          "200": {
            "description": "アカウントとトークンの情報。",
            "content": {
              "application/json": {
                "example": {
                  "account": {
                    "id": "0f8c2a4e-…",
                    "displayName": "健太",
                    "createdAt": "2026-03-14T10:00:00.000Z"
                  },
                  "token": {
                    "id": "7d0e2f8a-…",
                    "name": "Telegramボット",
                    "prefix": "pzk_Q7xR2mVb",
                    "createdAt": "2026-10-09T08:15:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "トークンがありません（`unauthorized`）。または、トークンが正しくないか取り消されています（`invalid_token`）。"
          },
          "403": {
            "description": "トークンの所有者がPolyzonの最新の利用規約に同意していません（`account_action_required`）。アカウントにログインして同意してください。または、このIPアドレスでは本日すでに他のアカウントが利用されています（`too_many_accounts`）。"
          },
          "429": {
            "description": "1分あたりのレート制限を超えたか（`rate_limited`）、1日のクォータ（`quota_exceeded`）またはIPアドレスの1日の上限（`address_quota_exceeded`）に達しました。`Retry-After`の秒数だけ待ってから再試行してください。"
          },
          "503": {
            "description": "カタログまたはトークンの検証が一時的に利用できません（`unavailable`）。しばらくしてから再試行してください。"
          }
        }
      }
    },
    "/v1/limits": {
      "get": {
        "operationId": "getLimits",
        "summary": "レート制限の残りを取得",
        "description": "1分間のウィンドウとUTCの1日について、上限、使用数、残り、リセット時刻（Unix時間、秒）を返します。1日のクォータは消費しません。",
        "x-daily-quota": false,
        "parameters": [],
        "responses": {
          "200": {
            "description": "ウィンドウごとのアカウントのクォータ。",
            "content": {
              "application/json": {
                "example": {
                  "perMinute": {
                    "limit": 20,
                    "used": 1,
                    "remaining": 19,
                    "resetAt": 1791579180
                  },
                  "daily": {
                    "limit": 200,
                    "used": 37,
                    "remaining": 163,
                    "resetAt": 1791590400
                  }
                }
              }
            }
          },
          "401": {
            "description": "トークンがありません（`unauthorized`）。または、トークンが正しくないか取り消されています（`invalid_token`）。"
          },
          "403": {
            "description": "トークンの所有者がPolyzonの最新の利用規約に同意していません（`account_action_required`）。アカウントにログインして同意してください。または、このIPアドレスでは本日すでに他のアカウントが利用されています（`too_many_accounts`）。"
          },
          "429": {
            "description": "1分あたりのレート制限を超えたか（`rate_limited`）、1日のクォータ（`quota_exceeded`）またはIPアドレスの1日の上限（`address_quota_exceeded`）に達しました。`Retry-After`の秒数だけ待ってから再試行してください。"
          },
          "503": {
            "description": "カタログまたはトークンの検証が一時的に利用できません（`unavailable`）。しばらくしてから再試行してください。"
          }
        }
      }
    }
  }
}