# JS Render

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v2/unlocker/request:
    post:
      summary: JS Render
      deprecated: false
      description: >-
        JavaScript rendering enables handling of dynamically loaded content and
        SPAs (Single Page Applications). Enables a complete browser environment,
        supporting more complex page interactions and rendering requirements.
      tags:
        - Universal Scraping API
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                actor:
                  type: string
                  description: actor name with fixed value:`unlocker.webunlocker`
                  enum:
                    - unlocker.webunlocker
                  x-apidog-enum:
                    - value: unlocker.webunlocker
                      name: webUnlocker
                      description: ''
                proxy:
                  type: object
                  properties:
                    country:
                      type: string
                      description: >-
                        proxy country, see more in [Scrapeless proxy
                        documentation](https://docs.scrapeless.com/en/proxies/features/proxy/)
                    url:
                      type: string
                      description: proxy url
                  x-apidog-orders:
                    - country
                    - url
                  description: proxy info
                  required:
                    - country
                  x-apidog-ignore-properties: []
                input:
                  type: object
                  properties:
                    url:
                      type: string
                      description: target URL
                    cookies:
                      description: cookies for JS render
                      $ref: '#/components/schemas/Cookies'
                    jsRender:
                      type: object
                      properties:
                        enabled:
                          type: boolean
                          default: true
                          description: enable JS rendering
                        headless:
                          type: boolean
                          description: whether processing in headless mode
                          default: true
                        waitUntil:
                          type: string
                          description: >-
                            when to consider waiting succeeds. given an array of
                            event strings, waiting is considered to be
                            successful after all events have been fired
                          enum:
                            - load
                            - domcontentloaded
                            - networkidle2
                            - networkidle0
                          x-apidog-enum:
                            - value: load
                              name: load
                              description: waits for the 'load' event
                            - value: domcontentloaded
                              name: domcontentloaded
                              description: waits for the 'DOMContentLoaded' event
                            - value: networkidle2
                              name: networkidle2
                              description: >-
                                waits till there are no more than 2 network
                                connections for at least `500` ms
                            - value: networkidle0
                              name: networkidle0
                              description: >-
                                waits till there are no more than 0 network
                                connections for at least `500` ms
                        instructions:
                          type: array
                          items:
                            type: object
                            properties:
                              wait:
                                type: integer
                                description: Wait for Wait for element
                              waitFor:
                                type: object
                                properties:
                                  '0':
                                    type: string
                                    description: Selector
                                  '1':
                                    type: integer
                                    description: Timeout(s)
                                x-apidog-orders:
                                  - '0'
                                  - '1'
                                description: Wait for element
                                x-apidog-ignore-properties: []
                              click:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    '0':
                                      type: string
                                      description: Selector
                                    '1':
                                      type: integer
                                      description: Timeout(s)
                                  x-apidog-orders:
                                    - '0'
                                    - '1'
                                  x-apidog-ignore-properties: []
                                description: Click element
                              fill:
                                type: object
                                properties:
                                  '0':
                                    type: string
                                    description: Selector
                                  '1':
                                    type: string
                                    description: value
                                x-apidog-orders:
                                  - '0'
                                  - '1'
                                description: Fill form
                                x-apidog-ignore-properties: []
                              keyboard:
                                type: object
                                properties:
                                  '0':
                                    type: string
                                    description: >-
                                      Press a specific
                                      [keyInput](https://pptr.dev/api/puppeteer.keyinput)
                                  '1':
                                    type: string
                                    description: key ｜ value
                                  '2':
                                    type: integer
                                    description: delay(ms)
                                x-apidog-orders:
                                  - '0'
                                  - '1'
                                  - '2'
                                description: >-
                                  [Keyboard
                                  Operations](https://docs.scrapeless.com/en/web-unlocker/features/js-render/#keyboard-operations)
                                x-apidog-ignore-properties: []
                              evaluate:
                                type: string
                                description: Execute custom javascript code
                            x-apidog-orders:
                              - wait
                              - waitFor
                              - click
                              - fill
                              - keyboard
                              - evaluate
                            x-apidog-ignore-properties: []
                          description: >-
                            [JavaScript Instructions
                            Reference](https://docs.scrapeless.com/en/web-unlocker/features/js-render/#javascript-instructions-reference)
                        block:
                          type: object
                          properties:
                            resources:
                              type: array
                              items:
                                type: string
                              description: block resources
                            urls:
                              type: array
                              items:
                                type: string
                              description: block urls
                          x-apidog-orders:
                            - resources
                            - urls
                          description: resources or urls to block
                          x-apidog-ignore-properties: []
                        response:
                          type: object
                          properties:
                            type:
                              type: string
                              description: response type
                              enum:
                                - html
                                - plaintext
                                - markdown
                                - png
                                - jpeg
                                - network
                                - content
                              x-apidog-enum:
                                - value: html
                                  name: html
                                  description: >-
                                    escaped raw HTML string of page, support CSS
                                    selector
                                - value: plaintext
                                  name: plaintext
                                  description: >-
                                    plaintext string of page, support CSS
                                    selector
                                - value: markdown
                                  name: markdown
                                  description: >-
                                    escaped Markdown string of page, support CSS
                                    selector
                                - value: png
                                  name: png
                                  description: >-
                                    base64 encoded string of page with `png`
                                    format, support CSS selector
                                - value: jpeg
                                  name: jpeg
                                  description: >-
                                    base64 encoded string of page with `jpeg`
                                    format, support CSS selector
                                - value: network
                                  name: network
                                  description: >-
                                    enable network request capture, it will
                                    collect all `XHR` and `fetch` requests made
                                    during page load and return their details
                                    with escaped JSON string format, do not
                                    support CSS selector
                                - value: content
                                  name: content
                                  description: >-
                                    filter data from page content, it returns
                                    the results in a escaped JSON string format
                              default: html
                            options:
                              type: object
                              properties:
                                selector:
                                  type: string
                                  description: >-
                                    CSS selector for output filters and
                                    specified response type. only works when
                                    type equals to one of`html | plaintext |
                                    markdown | png | jpeg`
                                fullPage:
                                  type: boolean
                                  description: >-
                                    whether takes a screen of the full page. 
                                    only works when type equals to`png`or`jpeg`
                                  default: false
                                urls:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    only include requests whose URL matches any
                                    of specified strings or patterns, supports
                                    substring match. only works when type equals
                                    to`network`
                                status:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    only include requests with specified HTTP
                                    status codes. only works when type equals
                                    to`network`
                                methods:
                                  type: array
                                  items:
                                    type: string
                                  description: >-
                                    only include requests with specified HTTP
                                    methods (e.g., GET, POST). only works when
                                    type equals to`network`
                                outputs:
                                  type: string
                                  description: >-
                                    filter data from HTML, it accepts a
                                    comma-separated list of filter names and
                                    returns the results in a escaped JSON string
                                    format. only works when type equals
                                    to`content`
                                  enum:
                                    - phone_numbers
                                    - headings
                                    - images
                                    - audios
                                    - videos
                                    - links
                                    - menus
                                    - hashtags
                                    - emails
                                    - metadata
                                    - tables
                                    - favicon
                                  x-apidog-enum:
                                    - value: phone_numbers
                                      name: ''
                                      description: ''
                                    - value: headings
                                      name: headings
                                      description: >-
                                        parse heading text from HTML elements
                                        `h1` through `h6`
                                    - value: images
                                      name: images
                                      description: >-
                                        parse image sources from `img` tags.
                                        Only the `src` attribute is returned
                                    - value: audios
                                      name: audios
                                      description: >-
                                        parse audio sources from `source`
                                        elements inside audio tags. Only the
                                        `src` attribute is returned
                                    - value: videos
                                      name: videos
                                      description: >-
                                        parse video sources from `source`
                                        elements inside video tags. Only the
                                        `src` attribute is returned
                                    - value: links
                                      name: links
                                      description: >-
                                        parse URLs from `a` tags. Only the
                                        `href` attribute is returned
                                    - value: menus
                                      name: menus
                                      description: >-
                                        parse menu items from `li` elements
                                        inside `menu` tags
                                    - value: hashtags
                                      name: hashtags
                                      description: >-
                                        parse hashtags using regular
                                        expressions, matching typical hashtag
                                        formats
                                    - value: emails
                                      name: emails
                                      description: >-
                                        parse email addresses for standard email
                                        formats like `example@example.com`
                                    - value: metadata
                                      name: metadata
                                      description: >-
                                        parse meta-information from meta tags in
                                        the format `name: content`
                                    - value: tables
                                      name: tables
                                      description: >-
                                        parse data from `table` elements,
                                        including dimensions, headings, and
                                        content
                                    - value: favicon
                                      name: favicon
                                      description: >-
                                        parse the favicon URL from the `link`
                                        element in the `head` section of the
                                        HTML.
                              x-apidog-orders:
                                - selector
                                - fullPage
                                - urls
                                - status
                                - methods
                                - outputs
                              description: response options
                              x-apidog-ignore-properties: []
                          x-apidog-orders:
                            - type
                            - options
                          required:
                            - type
                          description: response config
                          x-apidog-ignore-properties: []
                      x-apidog-orders:
                        - enabled
                        - headless
                        - waitUntil
                        - instructions
                        - block
                        - response
                      required:
                        - enabled
                        - response
                      description: JS render options
                      x-apidog-ignore-properties: []
                  required:
                    - url
                    - jsRender
                  x-apidog-orders:
                    - url
                    - cookies
                    - jsRender
                  x-apidog-ignore-properties: []
              required:
                - actor
                - proxy
                - input
              x-apidog-orders:
                - actor
                - proxy
                - input
              x-apidog-ignore-properties: []
            examples: {}
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  data:
                    type: string
                required:
                  - code
                  - data
                x-apidog-orders:
                  - code
                  - data
                x-apidog-ignore-properties: []
              example:
                code: 200
                data: ''
          headers: {}
          x-apidog-name: Success
      security:
        - apikey-header-x-api-token: []
      x-apidog-folder: Universal Scraping API
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/745098/apis/api-12948840-run
components:
  schemas:
    Cookies:
      type: array
      items:
        type: object
        properties:
          domain:
            type: string
            description: cookie domain
          path:
            type: string
            description: cookie path
          name:
            type: string
            description: cookie name
          value:
            type: string
            description: cookie value
          expires:
            type: integer
            description: >-
              cookie expiration date as the number of seconds since the UNIX
              epoch. Set to `-1` for session cookies
          sameSite:
            type: string
            description: cookie SameSite type
          secure:
            type: boolean
            description: '`true` if cookie is secure'
        required:
          - domain
          - path
          - name
          - value
        x-apidog-orders:
          - domain
          - path
          - name
          - value
          - expires
          - sameSite
          - secure
        description: cookie
        x-apidog-ignore-properties: []
      description: cookies for JS render
      x-apidog-folder: ''
  securitySchemes:
    bearer:
      type: bearer
      scheme: bearer
      description: Bearer token authentication using your Scrapeless API key
    apikey-header-x-api-token:
      type: apiKey
      in: header
      name: x-api-token
servers:
  - url: https://api.scrapeless.com
    description: Prod Env
security:
  - apikey-header-x-api-token: []

```
