Filtering by Resource Type

Websites load hundreds of resources every time a webpage is loaded. Filtering through all of these requests is critical to identifying and capturing Internal APIs.

Nimble's Network Capture can filter requests by one or more resource types to help isolate relevant network requests.

Example

Use the resource_type field to filter for specific resources:

curl -X POST 'https://api.webit.live/api/v1/realtime/web' \
--header 'Authorization: Basic <credential string>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "url": "https://www.example.com/",
    "render": true,
    "network_capture": [
        {
            "method": "GET",
            "resource_type": [
                "xhr", "script"
            ]
        }
    ]
}'

In the above example, we request to capture all XHR and Javascript requests peformed on the target data source's page.

Supported Resource Types

Some commonly used resource types include:

Click here for the full list of all supported resource types
'document',
'stylesheet',
'image',
'media',
'font',
'script',
'texttrack',
'xhr',
'fetch',
'prefetch',
'eventsource',
'webSocket',
'manifest',
'signedexchange',
'ping',
'cspviolationreport',
'preflight',
'other'

Multiple resource types can be used together by separating them with a comma:

"resource_type":["xhr", "fetch", "script"]

Response

The above request would return the following response:

{
    "url": "https://www.example.com/",
    "status": "success",
    "query_time": "2024-04-04T11:10:43.567Z",
    "html_content": "...",
    "status_code": 200,
    "headers": {
        ...
    },
    "input_url": "https://www.example.com/",
    "network_capture": [
        {
            "filter": {
                "method": "GET",
                "resource_type": [
                    "xhr",
                    "script"
                ]
            },
            "results": [
                {
                    "request": {
                        "resource_type": "script",
                        "method": "GET",
                        "url": "https://www.example.com/script/0001.js",
                        "headers": {
                            ...
                        }
                    },
                    "response": {
                        "status": 200,
                        "status_text": "",
                        "headers": {
                            ...
                        },
                        "serialization": "none",
			"body": "..."
                    }
                },
                {
                    "request": {
                        "resource_type": "xhr",
                        "method": "GET",
                        "url": "https://www.example.com/script/0002.js",
                        "headers": {
                            ...
                        }
                    },
                    "response": {
                        "status": 200,
                        "status_text": "",
                        "headers": {
                           ...
                        },
                        "serialization": "none",
			"body": "..."
                    }
                }
            ]
        }
    ]
}

Last updated