{
  "openapi": "3.0.3",
  "info": {
    "title": "Builder API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://agent.olostep.com"
    },
    {
      "url": "https://dataset.olostep.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer",
                "description": "Bearer authentication header of the form Bearer <token>, where <token> is your auth token."
      }
    }
  },
  "paths": {
    "/olostep-p2p-incomingAPI": {
      "get": {
        "summary": "Initiate web page scraping with various configurations",
        "description": "This endpoint allows users to scrape web pages with various options such as setting timeouts, wait time before scraping, data format preferences, and more.",
        "servers": [
          {
            "url": "https://agent.olostep.com"
          }
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "The URL to start scraping from.",
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "timeout",
            "in": "query",
            "required": false,
            "description": "Timeout in seconds for the scraping process, with a maximum of 620 seconds.",
            "schema": {
              "type": "integer",
              "default": 40
            }
          },
          {
            "name": "waitBeforeScraping",
            "in": "query",
            "required": false,
            "description": "Time to wait in seconds before starting the scraping, up to 500 seconds.",
            "schema": {
              "type": "integer",
              "default": 3
            }
          },
          {
            "name": "saveHtml",
            "in": "query",
            "required": false,
            "description": "Option to save the scraped content as HTML.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "saveMarkdown",
            "in": "query",
            "required": false,
            "description": "Option to save the scraped content as Markdown.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "removeCSSselectors",
            "in": "query",
            "required": false,
            "description": "Option to remove certain CSS selectors from the content. Optionally, you can also pass a JSON stringified array of specific selectors you want to remove. The CSS selectors removed when this option is set to `default` are `['nav','footer','script','style','noscript','svg',[role=alert],[role=banner],[role=dialog],[role=alertdialog],[role=region][aria-label*=skip i],[aria-modal=true]]`",
            "schema": {
              "type": "string",
              "default": "default",
              "enum": ["default", "none", "JSON stringified array of CSS selectors"]
            }
          },
          {
            "name": "htmlTransformer",
            "in": "query",
            "required": false,
            "description": "Specify the HTML transformer to use, if any. Postlight's Mercury Parser library is used to remove ads and other unwanted content from the scraped content.",
            "schema": {
              "type": "string",
              "default": "none",
              "enum": ["none", "postlightParser"]
            }
          },
          {
            "name": "removeImages",
            "in": "query",
            "required": false,
            "description": "Option to remove images from the scraped content.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "expandMarkdown",
            "in": "query",
            "required": false,
            "description": "If true, the markdown content is returned in the markdown_content field.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "expandHtml",
            "in": "query",
            "required": false,
            "description": "If true, the HTML content is returned in the html_content field.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "actions",
            "in": "query",
            "required": false,
            "description": "Actions to perform on the page before getting the content",
            "schema": {
              "type": "array",
              "items": {
                "type": "object",
                "discriminator": {
                  "propertyName": "type"
                },
                "oneOf": [
                  {
                    "type": "object",
                    "title": "Wait",
                    "required": [
                      "type",
                      "milliseconds"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "wait"
                        ],
                        "description": "Wait for a specified amount of milliseconds"
                      },
                      "milliseconds": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "Time to wait in milliseconds"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "Click",
                    "required": [
                      "type",
                      "selector"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "click"
                        ],
                        "description": "Click on an element"
                      },
                      "selector": {
                        "type": "string",
                        "description": "CSS selector for the element to click"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "Fill Input",
                    "required": [
                      "type",
                      "selector",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "fill_input"
                        ],
                        "description": "Fill an input element with a value"
                      },
                      "selector": {
                        "type": "string",
                        "description": "CSS selector for the input element"
                      },
                      "value": {
                        "type": "string",
                        "description": "Text to enter into the input"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "title": "Scroll",
                    "required": [
                      "type",
                      "direction",
                      "amount"
                    ],
                    "properties": {
                      "type": {
                        "type": "string",
                        "enum": [
                          "scroll"
                        ],
                        "description": "Scroll the page"
                      },
                      "direction": {
                        "type": "string",
                        "enum": [
                          "up",
                          "down",
                          "left",
                          "right"
                        ],
                        "description": "Direction to scroll"
                      },
                      "amount": {
                        "type": "number",
                        "description": "Amount to scroll in pixels"
                      }
                    }
                  }
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the requested data."
          },
          "400": {
            "description": "Bad request due to incorrect or missing parameters."
          },
          "401": {
            "description": "Unauthorized access due to missing or invalid API token."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    },
    "/olostep-p2p-dataset-API": {
      "get": {
        "servers": [
          {
            "url": "https://dataset.olostep.com"
          }
        ],
        "summary": "Retrieve dataset information",
        "description": "Allows users to retrieve dataset information in Markdown and/or HTML format based on the provided dataset ID.",
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "name": "datasetId",
            "in": "query",
            "required": true,
            "description": "Unique identifier for the dataset to be retrieved.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "retrieveMarkdown",
            "in": "query",
            "required": false,
            "description": "Option to retrieve the dataset in Markdown format.",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "retrieveHtml",
            "in": "query",
            "required": false,
            "description": "Option to retrieve the dataset in HTML format.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "fastLane",
            "in": "query",
            "required": false,
            "description": "Experimental option to speed up the scraping process",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response with the dataset information."
          },
          "400": {
            "description": "Bad request due to incorrect or missing parameters."
          },
          "404": {
            "description": "Dataset not found for the provided ID."
          },
          "500": {
            "description": "Internal server error."
          }
        }
      }
    }
  }
}
