# Similarity Determination API

以下は、APIキーのチェック機能を含めた類似度判定APIのリファレンスです。

***

**概要**

このAPIは、2つの単語の類似度を計算し、単語が同一かどうかと類似スコアを返します。APIの利用には有効なAPIキーが必要で、エンドポイントは `https://events-front.mixeder.net/v2/similar` です。APIキーはクエリパラメータ、POSTデータ、またはリクエストヘッダーから提供できます。

***

#### エンドポイント

```
GET /v2/similar
```

#### 認証

認証には、以下の方法でAPIキーを提供する必要があります。

1. **クエリパラメータ**: `?key=YOUR_API_KEY`
2. **POSTデータ**: `api-key=YOUR_API_KEY`
3. **ヘッダー**: `api-key: YOUR_API_KEY`

#### クエリパラメータ

| パラメータ   | 必須 | 説明                |
| ------- | -- | ----------------- |
| `word1` | はい | 比較したい最初の単語を指定します  |
| `word2` | はい | 比較したい2つ目の単語を指定します |
| `key`   | はい | APIキー             |

#### レスポンス

レスポンスはJSON形式で返され、以下の情報が含まれます。

| フィールド             | タイプ     | 説明                               |
| ----------------- | ------- | -------------------------------- |
| `isSame`          | boolean | `true` ならば `word1` と `word2` は同じ |
| `similarityScore` | float   | `0～100` の範囲で示される類似度スコア           |

#### 使用例

**1. 正しいAPIキーと単語を指定する場合**

リクエスト:

```http
GET https://events-front.mixeder.net/v2/similar?word1=hello&word2=halo&key=YOUR_API_KEY
```

レスポンス:

```json
{
    "isSame": false,
    "similarityScore": 75
}
```

**2. 無効なAPIキーの場合**

リクエスト:

```http
GET https://events-front.mixeder.net/v2/similar?word1=hello&word2=halo&key=INVALID_KEY
```

レスポンス:

```
API key is wrong
```

**3. APIキーが提供されていない場合**

リクエスト:

```http
GET https://events-front.mixeder.net/v2/similar?word1=hello&word2=world
```

レスポンス:

```
API Key not provided.
```

#### 使用上の注意

* APIキーが無効な場合にはエラーメッセージが返されます。

***

このAPIは、単語の比較や類似性のチェックを手軽に行うために設計されており、フィルタリング、データクレンジング、入力補完などの用途に活用可能です。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.mixeder.net/mixederpublicapis/apirifarensu/similarity-determination-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
