openapi: 3.0.0
info:
  title: HeadlessBrowserAPI
  version: 1.0.0
  description: HeadlessBrowserAPI is an advanced web scraping service designed to enable users to efficiently extract information from websites, including content generated by JavaScript. This API can be used to scrape and extract data from any website, it supports grabbing the full article or post content.
servers:
  - url: https://headlessbrowserapi.com
paths:
  /apis/scrape/v1/puppeteer:
    post:
      summary: Scrape any website and extract its readable content
      operationId: scrapeWebsite
      parameters:
        - name: url
          in: query
          required: true
          description: Add the URL you wish to scrape
          schema:
            type: string
        - name: readability
          in: query
          required: true
          description: This parameter needs to be set always to "on"
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  apicalls:
                    type: integer
                    description: The number of API calls remaining for your API key
                  url:
                    type: string
                    description: The URL that was scraped
                  html:
                    type: string
                    description: The scraped HTML content, with JavaScript rendered content
                  error:
                    type: string
                    description: The error message containing the reason of the failure (in case of error)
      security:
        - HTTPBearer: []
components:
  schemas:
    Source:
      type: object
      properties:
        id:
          type: string
          description: The identifier for the source
        name:
          type: string
          description: The display name for the source
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer