# ReturnJSON > Source: https://scrape.do/documentation/headless-browser/returnjson/ Capture network requests, frames, and websocket data Returns network requests in JSON format. It presents the content information as a property string. This feature only returns logs of XHR and Fetch requests - responses with images as content are not included. If you're using the screenshot parameter, it will output as a base64-encoded string. > [!NOTE] > `returnJSON` cannot be used without the `render=true` parameter! **cURL (API mode)** ```bash curl --location --request GET 'https://api.scrape.do/?token=YOUR_TOKEN&url=https://httpbin.co/anything&render=true&returnJSON=true' ``` **Python (API mode)** ```python import requests import urllib.parse token = "YOUR_TOKEN" targetUrl = urllib.parse.quote("https://httpbin.co/anything") render = "true" returnJson = "true" url = "http://api.scrape.do/?token={}&url={}&render={}&returnJSON={}".format(token, targetUrl,render,returnJson) response = requests.request("GET", url) print(response.text) ``` **Node.js (API mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = encodeURIComponent("https://httpbin.co/anything"); const render = "true"; const returnJson = "true" const config = { 'method': 'GET', 'url': `https://api.scrape.do/?token=${token}&url=${targetUrl}&render=${render}&returnJSON=${returnJson}`, 'headers': {} }; axios(config) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); ``` **cURL (Proxy mode)** ```bash curl -I -k -x "http://YOUR_TOKEN:render=true&returnJSON=true@proxy.scrape.do:8080" 'https://httpbin.co/anything' -v ``` **Python (Proxy mode)** ```python import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) url = "https://httpbin.co/anything" token = "YOUR_TOKEN" proxyModeUrl = "http://{}:render=true&returnJSON=true@proxy.scrape.do:8080".format(token) proxies = { "http": proxyModeUrl, "https": proxyModeUrl, } response = requests.request("GET", url, proxies=proxies, verify=False) print(response.text) ``` **Node.js (Proxy mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = "https://httpbin.co/anything"; axios({ method:"GET", url:targetUrl, proxy: { protocol:'http', host: 'proxy.scrape.do', port: 8080, auth: { username: token, password: 'render=true&returnJSON=true' } } }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error.message); }); ``` *(Go, Ruby, Java, C#, PHP examples are also available on the HTML version.)* --- ## Show Frames Returns all iframes content from the target webpage. To return iframes, set `showFrames=true`. This feature must be used with `render=true` and `returnJSON=true` parameters. When enabled, the response will include the content of all iframes found on the page in the JSON response. This is particularly useful for scraping sites that load content within iframes, such as embedded widgets, payment forms, or third-party content. **cURL (API mode)** ```bash curl --location --request GET 'https://api.scrape.do/?token=YOUR_TOKEN&url=https://httpbin.co/anything&render=true&returnJSON=true&showFrames=true' ``` **Python (API mode)** ```python import requests import urllib.parse token = "YOUR_TOKEN" targetUrl = urllib.parse.quote("https://httpbin.co/anything") render = "true" returnJson = "true" showFrames = "true" url = "http://api.scrape.do/?token={}&url={}&render={}&returnJSON={}&showFrames={}".format(token, targetUrl,render,returnJson,showFrames) response = requests.request("GET", url) print(response.text) ``` **Node.js (API mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = encodeURIComponent("https://httpbin.co/anything"); const render = "true"; const returnJson = "true"; const showFrames = "true"; const config = { 'method': 'GET', 'url': `https://api.scrape.do/?token=${token}&url=${targetUrl}&render=${render}&returnJSON=${returnJson}&showFrames=${showFrames}`, 'headers': {} }; axios(config) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); ``` **cURL (Proxy mode)** ```bash curl -k -x "http://YOUR_TOKEN:render=true&returnJSON=true&showFrames=true@proxy.scrape.do:8080" 'https://httpbin.co/anything' -v ``` **Python (Proxy mode)** ```python import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) url = "https://httpbin.co/anything" token = "YOUR_TOKEN" proxyModeUrl = "http://{}:render=true&returnJSON=true&showFrames=true@proxy.scrape.do:8080".format(token) proxies = { "http": proxyModeUrl, "https": proxyModeUrl, } response = requests.request("GET", url, proxies=proxies, verify=False) print(response.text) ``` **Node.js (Proxy mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = "https://httpbin.co/anything"; axios({ method:"GET", url:targetUrl, proxy: { protocol:'http', host: 'proxy.scrape.do', port: 8080, auth: { username: token, password: 'render=true&returnJSON=true&showFrames=true' } } }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error.message); }); ``` *(Go, Ruby, Java, C#, PHP examples are also available on the HTML version.)* ```json { "content": "...", // Main page content "frames": [ { "url": "https://example.com/frame1", "content": "..." // Frame 1 content }, { "url": "https://example.com/frame2", "content": "..." // Frame 2 content } ] } ``` --- ## Show Websocket Requests Provides the ability to view websocket requests. Websockets are used by modern web applications for real-time communication, including live chat systems, stock tickers, sports scores, and collaborative editing tools. > [!NOTE] > This feature must be used with `render=true` and `returnJSON=true` parameters. **cURL (API mode)** ```bash curl --location --request GET 'https://api.scrape.do/?token=YOUR_TOKEN&url=https://httpbin.co/anything&render=true&returnJSON=true&showWebsocketRequests=true' ``` **Python (API mode)** ```python import requests import urllib.parse token = "YOUR_TOKEN" targetUrl = urllib.parse.quote("https://httpbin.co/anything") render = "true" returnJson = "true" showWebsocketRequests = "true" url = "http://api.scrape.do/?token={}&url={}&render={}&returnJSON={}&showWebsocketRequests={}".format(token, targetUrl,render,returnJson,showWebsocketRequests) response = requests.request("GET", url) print(response.text) ``` **Node.js (API mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = encodeURIComponent("https://httpbin.co/anything"); const render = "true"; const returnJson = "true"; const showWebsocketRequests = "true"; const config = { 'method': 'GET', 'url': `https://api.scrape.do/?token=${token}&url=${targetUrl}&render=${render}&returnJSON=${returnJson}&showWebsocketRequests=${showWebsocketRequests}`, 'headers': {} }; axios(config) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); ``` **cURL (Proxy mode)** ```bash curl -k -x "http://YOUR_TOKEN:render=true&returnJSON=true&showWebsocketRequests=true@proxy.scrape.do:8080" 'https://httpbin.co/anything' -v ``` **Python (Proxy mode)** ```python import requests import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) url = "https://httpbin.co/anything" token = "YOUR_TOKEN" proxyModeUrl = "http://{}:render=true&returnJSON=true&showWebsocketRequests=true@proxy.scrape.do:8080".format(token) proxies = { "http": proxyModeUrl, "https": proxyModeUrl, } response = requests.request("GET", url, proxies=proxies, verify=False) print(response.text) ``` **Node.js (Proxy mode)** ```javascript const axios = require('axios'); const token = "YOUR_TOKEN"; const targetUrl = "https://httpbin.co/anything"; axios({ method:"GET", url:targetUrl, proxy: { protocol:'http', host: 'proxy.scrape.do', port: 8080, auth: { username: token, password: 'render=true&returnJSON=true&showWebsocketRequests=true' } } }) .then(response => { console.log(response.data); }) .catch(error => { console.error(error.message); }); ``` *(Go, Ruby, Java, C#, PHP examples are also available on the HTML version.)*