{
  "openapi": "3.0.0",
  "info": {
    "title": "WebExtrator Web Render & Extract",
    "version": "1.0.0",
    "description": "API reference for WebExtrator Web Render & Extract on Ace Data Cloud."
  },
  "servers": [
    {
      "url": "https://api.acedata.cloud",
      "description": "Ace Data Cloud API"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API token from https://platform.acedata.cloud"
      }
    },
    "schemas": {
      "WebextratorTaskRequestPayload": {
        "type": "object",
        "additionalProperties": true,
        "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Webextratortaskrequestpayload.63F43Bb460B9"
      },
      "WebextratorTaskResultPayload": {
        "type": "object",
        "additionalProperties": true,
        "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Webextratortaskresultpayload.397F900Eb4A9"
      },
      "WebextratorTaskRecord": {
        "type": "object",
        "required": [
          "id",
          "type",
          "created_at",
          "trace_id",
          "request"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Id.2Edddfd99D2E"
          },
          "type": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Type.C5259Bd9F2Aa"
          },
          "trace_id": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Trace Id.00701D972576"
          },
          "request": {
            "$ref": "#/components/schemas/WebextratorTaskRequestPayload"
          },
          "response": {
            "$ref": "#/components/schemas/WebextratorTaskResultPayload"
          },
          "created_at": {
            "type": "number",
            "format": "double",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Created At.2Ca18047C5A8"
          },
          "started_at": {
            "type": "number",
            "format": "double",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Started At.927B064E9596"
          },
          "finished_at": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Finished At.A9C31556Ce9D"
          },
          "elapsed": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "nullable": true,
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Elapsed.B9F607D2Fc40"
          },
          "user_id": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.User Id.58E496Ff394D"
          },
          "actor_user_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Actor User Id.C4750E96B2Ed"
          },
          "api_id": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Api Id.B5720084F533"
          },
          "application_id": {
            "type": "string",
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Application Id.513A41C09Cc1"
          },
          "credential_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Credential Id.1A72Db5A83Ef"
          },
          "authorization_id": {
            "type": "string",
            "nullable": true,
            "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Authorization Id.Ee3Ba168F602"
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/webextrator/extract": {
      "post": {
        "summary": "Webextrator Extract",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": true,
                    "task_id": "550e8400-e29b-41d4-a716-446655440000",
                    "trace_id": "550e8400-e29b-41d4-a716-446655440001",
                    "started_at": 1746181800.123,
                    "finished_at": 1746181808.789,
                    "elapsed": 8.666,
                    "data": {
                      "kind": "extract",
                      "url": "https://platform.acedata.cloud/documents/openai-images-edits",
                      "contentType": "product",
                      "title": "OpenAI Images Edits API",
                      "description": "Webextrator Extract Response 200 Example Data",
                      "byline": "Ace Data Cloud",
                      "siteName": "Ace Data Cloud",
                      "images": [
                        "https://cdn.acedata.cloud/nyq0xz.png"
                      ],
                      "links": [
                        "https://platform.acedata.cloud/documents/openai-images-generations"
                      ],
                      "markdown": "# OpenAI Images Edits API\n\nEdit images by providing an input image URL and a prompt.",
                      "structured": {
                        "service": "openai",
                        "endpoint": "/openai/images/edits",
                        "method": "POST"
                      }
                    }
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Webextrator Extract Response 200 Success"
                    },
                    "task_id": {
                      "type": "string",
                      "description": "Webextrator Extract Response 200 Task Id"
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "Webextrator Extract Response 200 Trace Id"
                    },
                    "started_at": {
                      "type": "number",
                      "description": "Webextrator Extract Response 200 Started At"
                    },
                    "finished_at": {
                      "type": "number",
                      "description": "Webextrator Extract Response 200 Finished At"
                    },
                    "elapsed": {
                      "type": "number",
                      "description": "Webextrator Extract Response 200 Elapsed"
                    },
                    "data": {
                      "type": "object",
                      "description": "Webextrator Extract Response 200 Data",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Kind"
                        },
                        "url": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Url"
                        },
                        "contentType": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Contenttype"
                        },
                        "title": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Title"
                        },
                        "description": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Description"
                        },
                        "byline": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Byline"
                        },
                        "siteName": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Sitename"
                        },
                        "images": {
                          "type": "array",
                          "description": "Webextrator Extract Response 200 Data Images",
                          "items": {
                            "type": "string"
                          }
                        },
                        "links": {
                          "type": "array",
                          "description": "Webextrator Extract Response 200 Data Links",
                          "items": {
                            "type": "string"
                          }
                        },
                        "markdown": {
                          "type": "string",
                          "description": "Webextrator Extract Response 200 Data Markdown"
                        },
                        "structured": {
                          "type": "object",
                          "description": "Webextrator Extract Response 200 Data Structured",
                          "properties": {
                            "price": {
                              "type": "number",
                              "description": "Webextrator Extract Response 200 Data Structured Price"
                            },
                            "currency": {
                              "type": "string",
                              "description": "Webextrator Extract Response 200 Data Structured Currency"
                            },
                            "brand": {
                              "type": "string",
                              "description": "Webextrator Extract Response 200 Data Structured Brand"
                            },
                            "rating": {
                              "type": "number",
                              "description": "Webextrator Extract Response 200 Data Structured Rating"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Webextrator Extract Response 200"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "bad_request",
                      "message": "url is required"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Extract Response 400"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "too_many_requests",
                      "message": "queue is busy"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Extract Response 429"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "api_error",
                      "message": "internal server error"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Extract Response 500"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "timeout",
                      "message": "extract exceeded timeout"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Extract Response 504"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "accept",
            "schema": {
              "enum": [
                "application/json"
              ],
              "type": "string"
            },
            "required": false,
            "description": "Webextrator Extract Param Accept"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://platform.acedata.cloud/documents/openai-images-edits",
                    "description": "Webextrator Extract Url"
                  },
                  "expected_type": {
                    "enum": [
                      "product",
                      "article",
                      "general"
                    ],
                    "type": "string",
                    "description": "Webextrator Extract Expected Type"
                  },
                  "enable_llm": {
                    "type": "boolean",
                    "default": false,
                    "description": "Webextrator Extract Enable Llm"
                  },
                  "wait_until": {
                    "enum": [
                      "load",
                      "domcontentloaded",
                      "networkidle",
                      "commit"
                    ],
                    "type": "string",
                    "default": "load",
                    "description": "Webextrator Extract Wait Until"
                  },
                  "timeout": {
                    "type": "integer",
                    "default": 30,
                    "description": "Webextrator Extract Timeout",
                    "minimum": 1
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Webextrator Extract Delay",
                    "minimum": 0
                  },
                  "wait_for_selector": {
                    "type": "string",
                    "description": "Webextrator Extract Wait For Selector"
                  },
                  "block_resources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "image",
                        "font",
                        "media",
                        "stylesheet",
                        "xhr",
                        "fetch"
                      ]
                    },
                    "description": "Webextrator Extract Block Resources"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Webextrator Extract Headers"
                  },
                  "user_agent": {
                    "type": "string",
                    "description": "Webextrator Extract User Agent"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://webhook.site/580b81f5-596e-4321-b03f-606770b0bb83",
                    "description": "Webextrator Extract Callback Url"
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Webextrator Extract Async"
                  },
                  "cookies": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "value",
                        "domain"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Webextrator Extract Cookies Name"
                        },
                        "value": {
                          "type": "string",
                          "description": "Webextrator Extract Cookies Value"
                        },
                        "domain": {
                          "type": "string",
                          "description": "Webextrator Extract Cookies Domain"
                        },
                        "path": {
                          "type": "string",
                          "description": "Webextrator Extract Cookies Path"
                        },
                        "expires": {
                          "type": "number",
                          "description": "Webextrator Extract Cookies Expires"
                        },
                        "httpOnly": {
                          "type": "boolean",
                          "description": "Webextrator Extract Cookies Httponly"
                        },
                        "secure": {
                          "type": "boolean",
                          "description": "Webextrator Extract Cookies Secure"
                        },
                        "sameSite": {
                          "type": "string",
                          "description": "Webextrator Extract Cookies Samesite",
                          "enum": [
                            "Strict",
                            "Lax",
                            "None"
                          ]
                        }
                      }
                    },
                    "description": "Webextrator Extract Cookies"
                  },
                  "bypass_cache": {
                    "type": "boolean",
                    "default": false,
                    "description": "Webextrator Extract Bypass Cache"
                  },
                  "cache_ttl_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 3600,
                    "description": "Webextrator Extract Cache Ttl Seconds"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "WebextratorcreateWebextratorExtract"
      }
    },
    "/webextrator/render": {
      "post": {
        "summary": "Webextrator Render",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": true,
                    "task_id": "550e8400-e29b-41d4-a716-446655440000",
                    "trace_id": "550e8400-e29b-41d4-a716-446655440001",
                    "started_at": 1746181800.123,
                    "finished_at": 1746181805.456,
                    "elapsed": 5.333,
                    "data": {
                      "kind": "render",
                      "url": "https://platform.acedata.cloud",
                      "finalUrl": "https://platform.acedata.cloud/",
                      "title": "Ace Data Cloud",
                      "status": 200,
                      "html": "<!doctype html><html lang=\"en\"><head><title>Ace Data Cloud</title></head><body>Ace Data Cloud</body></html>",
                      "text": "Ace Data Cloud provides AI data APIs for chat, image, video, audio, and web extraction.",
                      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/125.0 Safari/537.36",
                      "elapsedMs": 5300
                    }
                  },
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "description": "Webextrator Render Response 200 Success"
                    },
                    "task_id": {
                      "type": "string",
                      "description": "Webextrator Render Response 200 Task Id"
                    },
                    "trace_id": {
                      "type": "string",
                      "description": "Webextrator Render Response 200 Trace Id"
                    },
                    "started_at": {
                      "type": "number",
                      "description": "Webextrator Render Response 200 Started At"
                    },
                    "finished_at": {
                      "type": "number",
                      "description": "Webextrator Render Response 200 Finished At"
                    },
                    "elapsed": {
                      "type": "number",
                      "description": "Webextrator Render Response 200 Elapsed"
                    },
                    "data": {
                      "type": "object",
                      "description": "Webextrator Render Response 200 Data",
                      "properties": {
                        "kind": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Kind"
                        },
                        "url": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Url"
                        },
                        "finalUrl": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Finalurl"
                        },
                        "title": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Title"
                        },
                        "status": {
                          "type": "integer",
                          "description": "Webextrator Render Response 200 Data Status"
                        },
                        "html": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Html"
                        },
                        "text": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Text"
                        },
                        "userAgent": {
                          "type": "string",
                          "description": "Webextrator Render Response 200 Data Useragent"
                        },
                        "elapsedMs": {
                          "type": "integer",
                          "description": "Webextrator Render Response 200 Data Elapsedms"
                        }
                      }
                    }
                  }
                }
              }
            },
            "description": "Webextrator Render Response 200"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "bad_request",
                      "message": "url is required"
                    },
                    "trace_id": "..."
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Render Response 400"
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "too_many_requests",
                      "message": "queue is busy"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Render Response 429"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "api_error",
                      "message": "internal server error"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Render Response 500"
          },
          "504": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "success": false,
                    "error": {
                      "code": "timeout",
                      "message": "render exceeded timeout"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Render Response 504"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "accept",
            "schema": {
              "enum": [
                "application/json"
              ],
              "type": "string"
            },
            "required": false,
            "description": "Webextrator Render Param Accept"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://platform.acedata.cloud",
                    "description": "Webextrator Render Url"
                  },
                  "wait_until": {
                    "enum": [
                      "load",
                      "domcontentloaded",
                      "networkidle",
                      "commit"
                    ],
                    "type": "string",
                    "default": "load",
                    "description": "Webextrator Render Wait Until"
                  },
                  "timeout": {
                    "type": "integer",
                    "default": 30,
                    "description": "Webextrator Render Timeout",
                    "minimum": 1
                  },
                  "delay": {
                    "type": "integer",
                    "description": "Webextrator Render Delay",
                    "minimum": 0
                  },
                  "wait_for_selector": {
                    "type": "string",
                    "description": "Webextrator Render Wait For Selector"
                  },
                  "block_resources": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "image",
                        "font",
                        "media",
                        "stylesheet",
                        "xhr",
                        "fetch"
                      ]
                    },
                    "description": "Webextrator Render Block Resources"
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Webextrator Render Headers"
                  },
                  "user_agent": {
                    "type": "string",
                    "description": "Webextrator Render User Agent"
                  },
                  "callback_url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://webhook.site/580b81f5-596e-4321-b03f-606770b0bb83",
                    "description": "Webextrator Render Callback Url"
                  },
                  "async": {
                    "type": "boolean",
                    "description": "Webextrator Render Async"
                  },
                  "cookies": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "value",
                        "domain"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Webextrator Render Cookies Name"
                        },
                        "value": {
                          "type": "string",
                          "description": "Webextrator Render Cookies Value"
                        },
                        "domain": {
                          "type": "string",
                          "description": "Webextrator Render Cookies Domain"
                        },
                        "path": {
                          "type": "string",
                          "description": "Webextrator Render Cookies Path"
                        },
                        "expires": {
                          "type": "number",
                          "description": "Webextrator Render Cookies Expires"
                        },
                        "httpOnly": {
                          "type": "boolean",
                          "description": "Webextrator Render Cookies Httponly"
                        },
                        "secure": {
                          "type": "boolean",
                          "description": "Webextrator Render Cookies Secure"
                        },
                        "sameSite": {
                          "type": "string",
                          "description": "Webextrator Render Cookies Samesite",
                          "enum": [
                            "Strict",
                            "Lax",
                            "None"
                          ]
                        }
                      }
                    },
                    "description": "Webextrator Render Cookies"
                  },
                  "bypass_cache": {
                    "type": "boolean",
                    "default": false,
                    "description": "Webextrator Render Bypass Cache"
                  },
                  "cache_ttl_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "default": 3600,
                    "description": "Webextrator Render Cache Ttl Seconds"
                  }
                }
              }
            }
          },
          "required": true
        },
        "operationId": "WebextratorcreateWebextratorRender"
      }
    },
    "/webextrator/tasks": {
      "post": {
        "summary": "Webextrator Tasks",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/WebextratorTaskRecord"
                    },
                    {
                      "type": "object",
                      "required": [
                        "items",
                        "count"
                      ],
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/WebextratorTaskRecord"
                          },
                          "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Items.5402Bcfb5D16"
                        },
                        "count": {
                          "type": "integer",
                          "minimum": 0,
                          "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.Count.0078A843Cc37"
                        }
                      }
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "description": "Openapi.C9E67E77D4484A78Bdd191567E0A318A.2.00Aed83E16Ae"
                    }
                  ]
                }
              }
            },
            "description": "Webextrator Tasks Response 200"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "example": {
                    "error": {
                      "code": "bad_request",
                      "message": "invalid action"
                    }
                  },
                  "additionalProperties": true
                }
              }
            },
            "description": "Webextrator Tasks Response 400"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "accept",
            "schema": {
              "enum": [
                "application/json"
              ],
              "type": "string"
            },
            "required": false,
            "description": "Webextrator Tasks Param Accept"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "enum": [
                      "retrieve",
                      "retrieve_batch"
                    ],
                    "type": "string",
                    "default": "retrieve",
                    "description": "Webextrator Tasks Action"
                  },
                  "id": {
                    "type": "string",
                    "description": "Webextrator Tasks Id"
                  },
                  "trace_id": {
                    "type": "string",
                    "description": "Webextrator Tasks Trace Id"
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Webextrator Tasks Ids"
                  },
                  "trace_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Webextrator Tasks Trace Ids"
                  },
                  "offset": {
                    "type": "number",
                    "default": 0,
                    "description": "Webextrator Tasks Offset"
                  },
                  "limit": {
                    "type": "number",
                    "default": 12,
                    "description": "Webextrator Tasks Limit"
                  }
                },
                "example": {
                  "action": "retrieve",
                  "id": "task-id"
                }
              }
            }
          },
          "required": true
        },
        "operationId": "queryWebextratorTasks"
      }
    }
  }
}
