{
  "openapi": "3.0.0",
  "info": {
    "title": "neo146 HTTP API",
    "description": "neo146 provides a minimal HTTP-SMS gateway that serves as an emergency network connection method inspired by dial-up, allowing you to access content via SMS.",
    "version": "1.0.0",
    "contact": {
      "email": "neo146@riseup.net"
    }
  },
  "servers": [
    {
      "url": "https://neo146.net",
      "description": "Production server"
    },
    {
      "url": "http://localhost:8080",
      "description": "Development server"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "summary": "Service documentation",
        "description": "Returns basic documentation about the neo146 service",
        "responses": {
          "200": {
            "description": "Documentation text",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/uri2md": {
      "get": {
        "summary": "Convert URI to Markdown",
        "description": "Fetches the content at the given URI and converts it to Markdown format",
        "parameters": [
          {
            "in": "query",
            "name": "uri",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "URI to fetch and convert to Markdown"
          },
          {
            "in": "query",
            "name": "b64",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to base64 encode the response"
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing parameter",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/twitter": {
      "get": {
        "summary": "Get tweets from user",
        "description": "Fetches the last 5 tweets from a Twitter user",
        "parameters": [
          {
            "in": "query",
            "name": "user",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Twitter username"
          },
          {
            "in": "query",
            "name": "b64",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to base64 encode the response"
          }
        ],
        "responses": {
          "200": {
            "description": "Tweets content",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing parameter",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ddg": {
      "get": {
        "summary": "Search with DuckDuckGo",
        "description": "Search the web using DuckDuckGo",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Search query"
          },
          {
            "in": "query",
            "name": "b64",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Whether to base64 encode the response"
          }
        ],
        "responses": {
          "200": {
            "description": "Search results",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - missing parameter",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}