> ## Documentation Index
> Fetch the complete documentation index at: https://help.decodo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript Rendering

> Web Scraping API JavaScript Rendering

## What is JavaScript Rendering

JavaScript rendering is the process of executing JavaScript on a webpage to generate dynamic content. Dynamic content refers to data or elements that are loaded or updated on the webpage after the initial HTML is delivered. Many modern websites rely on JavaScript to load data and modify their layout in real time.

## Not Using VS Using JavaScript Rendering

Not using JavaScript rendering:

* Retrieves only the initial `HTML`.
* Fast and resource-efficient, but misses dynamic content.

Using JavaScript rendering:

* Executes JavaScript to load full content, including dynamic data.
* Slower and resource-intensive, but essential for modern dynamic sites.

## When to Use JavaScript Rendering

* **Static Websites:** No JS rendering needed.
* **Dynamic Websites:** Use JS rendering to capture complete content.
* **Interactive Elements:** Necessary for scraping data behind user interactions. For example, [**browser actions**](https://help.decodo.com/docs/web-scraping-api-browser-actions).

## How to Use JavaScript Rendering in Your Requests

To include rendering to your request, you will need to add the `headless` parameter with either `html` or `png` set as the value.

<CodeGroup>
  ```shellscript cURL theme={null}
  # update 'TOKEN VALUE' with your authorization token
  curl --request 'POST' \
          --url 'https://scraper-api.decodo.com/v2/scrape' \
          --header 'Accept: application/json' \
          --header 'Authorization:Basic TOKEN VALUE' \
          --header 'Content-Type: application/json' \
          --data '
      {
        "url": "https://ip.decodo.com/ip",
        "headless": "html"
      }
  '
  ```
</CodeGroup>

Screenshot response is available when the headless parameter is set to `png`, read more [<u>here</u>](https://help.decodo.com/docs/web-scraping-api-screenshot-response).

***

<Columns cols={2}>
  <Card title="Support" href="https://direct.lc.chat/12092754" cta="Let's chat!">
    Need help or just want to say hello? Our support is available 24/7. \
    You can also reach us anytime via email at [support@decodo.com](mailto:support@decodo.com).
  </Card>

  <Card title="Feedback" href="mailto:feedback@decodo.com" cta="Share feedback">
    Can't find what you're looking for? Request an article! \
    Have feedback? Share your thoughts on how we can improve.
  </Card>
</Columns>
