Apidog allows you to visually extract values from API responses and save them as variables for use in subsequent requests.1
Add Extract Variable ProcessorIn the Post Processors section of your request, hover over + Add and select Extract Variable. 2
Configure Extraction SettingsVariable Name: Define the name of the variable to store.
Scope: Choose where the variable will be accessible (Local, Environment, or Global).
Source: Select where to extract data from (e.g., Response JSON, Header, Cookie).
3
Define Extraction RuleFor JSON or XML responses, use JSONPath or XPath to target specific data. 4
Execute and VerifyClick Send. The variable will be updated, and you can view the extraction log in the Console. You can quickly create extraction rules directly from the response panel:1.
Hover over a field in the response.
3.
The rule will be automatically populated in the Post Processors.
| Source | Description | Method |
|---|
| Response JSON | Extract data from JSON bodies. | JSONPath |
| Response XML | Extract data from XML bodies. | XPath |
| Response Text | Extract text from raw responses. | Regular Expressions (Regex) |
| Response Header | Extract specific header values. | Header Name |
| Response Cookie | Extract specific cookie values. | Cookie Name |
| Response Time | Store the request duration. | N/A |
To help you construct correct JSONPath expressions, Apidog provides a visual extraction tool:1.
Click the icon next to the JSONPath input field. 2.
Enter your expression. The tool shows the JSON response on the left and the extraction result on the right. Elements with wildcards (e.g., books[*]) return an array. To extract a single value without brackets, enable Continue extracting and specify the array index in the tool.