{
  "openapi": "3.1.0",
  "info": {
    "title": "USD MVR Maldives Exchange Rate API",
    "description": "A simple API to retrieve the live, crowd-sourced blackmarket exchange rate for USD to MVR (Maldivian Rufiyaa).",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://usdmvr.com",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api.php": {
      "get": {
        "operationId": "getCurrentRate",
        "summary": "Get current USD to MVR exchange rate",
        "description": "Retrieves the latest crowd-sourced blackmarket exchange rate, total submission count, and last update timestamp.",
        "responses": {
          "200": {
            "description": "Successful response containing the latest exchange rate data.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "pair": {
                          "type": "string",
                          "example": "USD/MVR"
                        },
                        "rate": {
                          "type": "number",
                          "format": "float",
                          "example": 22.35
                        },
                        "total_submissions": {
                          "type": "integer",
                          "example": 5172
                        },
                        "last_updated_timestamp": {
                          "type": "integer",
                          "description": "Unix timestamp of the last update.",
                          "example": 1723467614
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "source": {
                          "type": "string",
                          "example": "https://usdmvr.com"
                        },
                        "description": {
                          "type": "string",
                          "example": "Crowd-sourced USD Blackmarket Rate in Maldives"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server error or corrupted data file.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "example": false
                    },
                    "error": {
                      "type": "string",
                      "example": "Data file is corrupted or unreadable."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}