PDF GPT

PDF GPT · Acciones GPT

FastAPI PDF and Link Content Extractor

Extract PDF content and read content from links.

  • POST /pdf-to-json/Summarise the PDF
  • POST /pdf-gdrive-to-json/Convert Google Drive PDF to JSON
Esquema original API
{
  "openapi": "3.0.3",
  "info": {
    "title": "FastAPI PDF and Link Content Extractor",
    "version": "1.0.0",
    "description": "Extract PDF content and read content from links.",
    "contact": {
      "name": "Angshuman Gupta",
      "email": "angshu.gupta789@gmail.com"
    }
  },
  "servers": [
    {
      "url": "https://pdf-gpt-iota.vercel.app"
    }
  ],
  "paths": {
    "/pdf-to-json/": {
      "post": {
        "summary": "Summarise the PDF",
        "operationId": "pdfToJson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The URL of the PDF to download and convert to JSON."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF content returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "description": "The page number."
                      },
                      "text": {
                        "type": "string",
                        "description": "The extracted text from the page."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request due to invalid URL or download failure."
          },
          "500": {
            "description": "Internal server error when processing the PDF."
          }
        }
      }
    },
    "/pdf-gdrive-to-json/": {
      "post": {
        "summary": "Convert Google Drive PDF to JSON",
        "operationId": "pdfGdriveToJson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "The Google Drive URL of the PDF to download and convert to JSON."
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Google Drive PDF content returned as JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "page": {
                        "type": "integer",
                        "description": "The page number."
                      },
                      "text": {
                        "type": "string",
                        "description": "The extracted text from the page."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request due to invalid Google Drive URL or download failure."
          },
          "500": {
            "description": "Internal server error when processing the Google Drive PDF."
          }
        }
      }
    }
  }
}