{
  "openapi": "3.1.0",
  "info": {
    "title": "Thesaurus API",
    "version": "1.0.0",
    "description": "Synonyms and antonyms for English words, grouped by part of speech and ranked by sense, from WordNet 3.1.\n\nSynonyms and antonyms for English words, grouped by part of speech and ranked by how common each sense is, from Princeton WordNet 3.1. Ask for synonyms, antonyms or both in one call. Self-hosted, no third-party service.",
    "contact": {
      "name": "Data and APIs",
      "url": "https://dataandapis.com/contact"
    },
    "termsOfService": "https://dataandapis.com/terms-of-service",
    "license": {
      "name": "Data and APIs Terms of Service",
      "url": "https://dataandapis.com/terms-of-service"
    },
    "x-logo": {
      "url": "https://dataandapis.com/images/thesaurus.webp"
    }
  },
  "externalDocs": {
    "description": "Documentation, live tester and pricing",
    "url": "https://dataandapis.com/apis/thesaurus"
  },
  "servers": [
    {
      "url": "https://api-thesaurus.dataandapis.com"
    }
  ],
  "tags": [
    {
      "name": "Data",
      "description": "Thesaurus API belongs to the Data category of the Data and APIs catalog."
    }
  ],
  "paths": {
    "/v1/thesaurus/{word}": {
      "get": {
        "operationId": "fullThesaurus",
        "summary": "Full Thesaurus",
        "description": "Full Thesaurus endpoint of the Thesaurus API. Costs 2 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/thesaurus/full-thesaurus"
        },
        "parameters": [
          {
            "name": "word",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "happy"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "word": "happy",
                  "synonym_count": 3,
                  "synonyms": {
                    "adjective": [
                      "felicitous",
                      "glad",
                      "well-chosen"
                    ]
                  },
                  "antonym_count": 1,
                  "antonyms": {
                    "adjective": [
                      "unhappy"
                    ]
                  },
                  "source": "Princeton WordNet 3.1"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/antonyms/{word}": {
      "get": {
        "operationId": "getAntonyms",
        "summary": "Get Antonyms",
        "description": "Get Antonyms endpoint of the Thesaurus API. Costs 2 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/thesaurus/get-antonyms"
        },
        "parameters": [
          {
            "name": "word",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "happy"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "word": "happy",
                  "antonym_count": 1,
                  "antonyms": {
                    "adjective": [
                      "unhappy"
                    ]
                  },
                  "source": "Princeton WordNet 3.1"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    },
    "/v1/synonyms/{word}": {
      "get": {
        "operationId": "getSynonyms",
        "summary": "Get Synonyms",
        "description": "Get Synonyms endpoint of the Thesaurus API. Costs 2 tokens per call.",
        "externalDocs": {
          "url": "https://dataandapis.com/apis/thesaurus/get-synonyms"
        },
        "parameters": [
          {
            "name": "word",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "happy"
          },
          {
            "name": "pos",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "adjective"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "ok": true,
                  "word": "happy",
                  "synonym_count": 3,
                  "synonyms": {
                    "adjective": [
                      "felicitous",
                      "glad",
                      "well-chosen"
                    ]
                  },
                  "source": "Princeton WordNet 3.1"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key"
          },
          "402": {
            "description": "Subscription past due; the response carries a payment_url"
          },
          "429": {
            "description": "Monthly token allowance exhausted"
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Create a free key at https://dataandapis.com/sign-up. 500 tokens a month on the Free plan; this API costs 2 tokens per call."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}