Skip to main content
Core and Advanced plans are no longer available for purchase. Please consider migrating to the all-in-one Web Scraper API; check out the guide here.

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.

How to Use JavaScript Rendering in Your Requests

To include rendering in your request, you will need to add the headless parameter with either html or png set as the value.
# 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 '
    {
      "target": "universal",
      "url": "https://ip.decodo.com/ip",
      "headless": "html"
    }
'
More information on png response can be found here.
Scraping API Core subscriptions are not able to use the JavaScript rendering parameter, only Advanced subscriptions are eligible.

Google and JavaScript Rendering

Google targets require JS rendering, and are only reachable with our Advanced scraping API subscriptions.

Support

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.

Feedback

Can’t find what you’re looking for? Request an article!
Have feedback? Share your thoughts on how we can improve.