{
  "openapi": "3.1.0",
  "info": {
    "title": "DuolingoDMH public API",
    "version": "1.1.0",
    "summary": "Read-only data about the DuolingoDMH Duolingo Super and Max upgrade service.",
    "description": "DuolingoDMH upgrades a personal Duolingo account to Duolingo Super or Max through the official Family plan. This API exposes the current plans and prices, the FAQ and the support channels. It is read-only and needs no authentication. Ordering is not available through the API: agents should hand the user the contact channels from getContactChannels. Errors are JSON with a stable `code` and a `hint`. Human docs: /developers.\n\nRate limits: 60 requests per minute per IP. Responses carry the IETF `RateLimit` and `RateLimit-Policy` headers (draft-ietf-httpapi-ratelimit-headers) and a 429 carries `Retry-After`.\n\nVersioning: the major version is in the path (/api/v1); `info.version` follows semantic versioning and additive changes do not change the path. A deprecated operation is marked `deprecated: true` and its responses carry the Deprecation (RFC 9745) and Sunset (RFC 8594) headers, at least 180 days before it stops working. Policy: /developers/versioning.\n\nCLI: `npx duolingodmh plans` (npm package duolingodmh), see /developers/cli.",
    "termsOfService": "https://duongminhhoang.store/terms",
    "contact": {
      "name": "DuolingoDMH",
      "url": "https://duongminhhoang.store/contact"
    }
  },
  "externalDocs": {
    "description": "DuolingoDMH API developer docs",
    "url": "https://duongminhhoang.store/developers"
  },
  "servers": [
    {
      "url": "https://duongminhhoang.store",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Catalog",
      "description": "Plans and prices."
    },
    {
      "name": "Support",
      "description": "FAQ and contact channels."
    },
    {
      "name": "Meta",
      "description": "API discovery."
    }
  ],
  "security": [],
  "paths": {
    "/api/v1": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "Meta"
        ],
        "summary": "List the public API endpoints",
        "description": "Returns the API name and version, links to the OpenAPI document, docs, deprecation policy and CLI, and the list of available endpoints. Use `tag` to list only the endpoints of one group.",
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Return only endpoints in this group: catalog (plans), support (FAQ, contact) or meta (this index).",
            "schema": {
              "type": "string",
              "enum": [
                "catalog",
                "support",
                "meta"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API index.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "400": {
            "description": "The tag value is not one of the allowed values (code invalid_parameter).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (code rate_limited). Wait for Retry-After seconds, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          }
        }
      }
    },
    "/api/v1/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": [
          "Catalog"
        ],
        "summary": "List Duolingo upgrade plans and prices",
        "description": "Returns the active Duolingo Super and Max plans, one entry per plan, with the VND list price and a reference USD price. Use `family` to narrow the list. Prices can change, so do not cache for long.",
        "parameters": [
          {
            "name": "family",
            "in": "query",
            "required": false,
            "description": "Return only plans of this family.",
            "schema": {
              "type": "string",
              "enum": [
                "super",
                "max",
                "family",
                "trial"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The plans.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanList"
                }
              }
            }
          },
          "400": {
            "description": "The family value is not one of the allowed values (code invalid_parameter).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (code rate_limited). Wait for Retry-After seconds, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          },
          "500": {
            "description": "The data source is temporarily unavailable. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/faqs": {
      "get": {
        "operationId": "listFaqs",
        "tags": [
          "Support"
        ],
        "summary": "List frequently asked questions",
        "description": "Returns the FAQ about safety, passwords, streaks, warranty and pricing, in English or Vietnamese.",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of the questions and answers: en (English) or vi (Vietnamese). Defaults to en.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "vi"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The FAQ entries.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaqList"
                }
              }
            }
          },
          "400": {
            "description": "The lang value is not en or vi (code invalid_parameter).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (code rate_limited). Wait for Retry-After seconds, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          },
          "500": {
            "description": "The data source is temporarily unavailable. Retry shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contact": {
      "get": {
        "operationId": "getContactChannels",
        "tags": [
          "Support"
        ],
        "summary": "Get support and ordering channels",
        "description": "Returns the WhatsApp, Telegram, Zalo and Facebook channels, how to order and the key page URLs. Give these to the user to place an order. Use `lang` for the description and ordering steps in the user's language.",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of the description and ordering steps: en (English) or vi (Vietnamese). Defaults to en.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "vi"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact channels.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactInfo"
                }
              }
            }
          },
          "400": {
            "description": "The lang value is not en or vi (code invalid_parameter).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (code rate_limited). Wait for Retry-After seconds, then retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Link": {
                "$ref": "#/components/headers/Link"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "headers": {
      "RateLimit": {
        "description": "Remaining quota of the \"default\" policy, as `\"default\";r=<remaining>;t=<seconds until the window resets>` (IETF draft-ietf-httpapi-ratelimit-headers).",
        "schema": {
          "type": "string",
          "examples": [
            "\"default\";r=59;t=60"
          ]
        }
      },
      "RateLimit-Policy": {
        "description": "Quota policy, as `\"default\";q=<requests>;w=<window in seconds>`.",
        "schema": {
          "type": "string",
          "examples": [
            "\"default\";q=60;w=60"
          ]
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before the next request. Sent with 429 only.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "X-RateLimit-Limit": {
        "description": "Legacy: requests allowed per window. Use RateLimit-Policy.",
        "deprecated": true,
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Legacy: requests left in the current window. Use RateLimit.",
        "deprecated": true,
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Legacy: Unix time (seconds) when the window resets. Use RateLimit.",
        "deprecated": true,
        "schema": {
          "type": "integer"
        }
      },
      "Link": {
        "description": "Always includes </developers/versioning>; rel=\"deprecation\" (RFC 9745). A deprecated endpoint also links its replacement with rel=\"successor-version\" and sends Deprecation and Sunset headers.",
        "schema": {
          "type": "string"
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "description": "Error returned for every failed request.",
        "required": [
          "error",
          "code",
          "message",
          "hint",
          "status",
          "docs_url"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message (same as message)."
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code.",
            "examples": [
              "not_found",
              "invalid_parameter",
              "rate_limited",
              "method_not_allowed",
              "internal_error",
              "unauthorized"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable message."
          },
          "hint": {
            "type": "string",
            "description": "How to fix the request."
          },
          "status": {
            "type": "integer",
            "description": "HTTP status code."
          },
          "docs_url": {
            "type": "string",
            "format": "uri",
            "description": "Link to the error documentation."
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "required": [
          "name",
          "version",
          "openapi_url",
          "docs_url",
          "deprecation_policy_url",
          "cli_url",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "description": "Semantic version of the API contract."
          },
          "openapi_url": {
            "type": "string",
            "format": "uri"
          },
          "docs_url": {
            "type": "string",
            "format": "uri"
          },
          "deprecation_policy_url": {
            "type": "string",
            "format": "uri",
            "description": "Versioning and deprecation policy."
          },
          "cli_url": {
            "type": "string",
            "format": "uri",
            "description": "Docs for the official command-line tool."
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "operation_id",
                "method",
                "path",
                "tag",
                "description",
                "deprecated"
              ],
              "properties": {
                "operation_id": {
                  "type": "string"
                },
                "method": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "tag": {
                  "type": "string",
                  "enum": [
                    "catalog",
                    "support",
                    "meta"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "deprecated": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "Plan": {
        "type": "object",
        "required": [
          "id",
          "name",
          "label",
          "family",
          "duration",
          "price_vnd",
          "original_price_vnd",
          "price_usd",
          "is_free_trial",
          "description",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable slug of the plan, for example super-1-year."
          },
          "name": {
            "type": "string",
            "description": "Plan name as shown on the Vietnamese page."
          },
          "label": {
            "type": "string",
            "description": "Short English label, for example \"Super · 1 year\"."
          },
          "family": {
            "type": "string",
            "enum": [
              "super",
              "max",
              "family",
              "trial"
            ],
            "description": "Plan family."
          },
          "duration": {
            "type": [
              "string",
              "null"
            ],
            "description": "Length, for example \"1 year\". Null when unknown."
          },
          "price_vnd": {
            "type": "integer",
            "minimum": 0,
            "description": "List price in Vietnamese dong. 0 for the free trial."
          },
          "original_price_vnd": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Price before discount in VND, or null."
          },
          "price_usd": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "description": "Reference USD price rounded to .99. 0 for the free trial, null if it cannot be converted."
          },
          "is_free_trial": {
            "type": "boolean",
            "description": "True for the free trial plan."
          },
          "description": {
            "type": "string",
            "description": "Plan description."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Page where the plan is listed."
          }
        }
      },
      "PlanList": {
        "type": "object",
        "required": [
          "plans",
          "count",
          "currency_note",
          "usd_vnd_rate"
        ],
        "properties": {
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "currency_note": {
            "type": "string",
            "description": "How to read the prices."
          },
          "usd_vnd_rate": {
            "type": "integer",
            "description": "VND per USD used for the reference conversion."
          }
        }
      },
      "Faq": {
        "type": "object",
        "required": [
          "id",
          "question",
          "answer"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "answer": {
            "type": "string"
          }
        }
      },
      "FaqList": {
        "type": "object",
        "required": [
          "language",
          "faqs",
          "count"
        ],
        "properties": {
          "language": {
            "type": "string",
            "enum": [
              "en",
              "vi"
            ]
          },
          "faqs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Faq"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ContactChannel": {
        "type": "object",
        "required": [
          "type",
          "label",
          "value",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "whatsapp",
              "telegram",
              "zalo",
              "facebook"
            ]
          },
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "description": "Number or handle to show to the user."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Link that opens the chat."
          }
        }
      },
      "ContactInfo": {
        "type": "object",
        "required": [
          "name",
          "owner",
          "language",
          "description",
          "languages",
          "channels",
          "how_to_order",
          "pages"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "language": {
            "type": "string",
            "enum": [
              "en",
              "vi"
            ],
            "description": "Language of description and how_to_order."
          },
          "description": {
            "type": "string"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactChannel"
            }
          },
          "how_to_order": {
            "type": "string"
          },
          "pages": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            }
          }
        }
      }
    }
  }
}