Create or update the parameters and ruleset of an existing Custom API
Request
| Authentication | |
|---|---|
token | Cache and insert token into example requests (15d expiry) |
| Request body application/json | |
|---|---|
notes | An array of strings that can be added manually. The API automatically adds a notes specifying when the API was last updated. |
xForwardHeaders | Allows you to pass in X-Forward headers by name, including X-Evaluate (aka. X-Forward-X-Evaluate; omit “X-Forward” in the header name) |
X-Evaluate | |
rules | An object that defines a set of rules for a specific urlPattern-api combination |
name | |
selector | |
filters | |
args | |
type | |
api | The specific API being targeted. Always precede the API name with “/api/” as in |
urlPattern | A regex that defines the URLs for which the ruleset will be applied |
testUrl | A URL that can be used to check that the rule still works as intended. This is the page that will load automatically when editing the ruleset in the Dashboard UI |
renderOptions | Rendering options |
prefilters | An array of string selectors that should be omitted from the DOM before extraction occurs |
useProxy | Used to disable proxies (when they have been set globally), by applying the value |
Example request
curl --request POST \
--url 'https://api.diffbot.com/v3/custom?token=<DIFFBOT_TOKEN>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{}'
Response
| 200Successful API Response | |
|---|---|
hashes |
{
"hashes": [
"abcd1234"
]
}