Skip to content

Retrieve Custom APIs

GEThttps://api.diffbot.com/v3/custom

Get all the Custom APIs and their rules currently defined on your token.

Returns a JSON array of all of the Custom APIs attached to a token. Each record in the array will include the complete Custom API ruleset and definition.

This endpoint can be used to quickly and easily make backups of your Custom APIs before updating them (which is an irreversible change).

Run In Postman

Example

bash
curl --request GET \
  --url 'https://api.diffbot.com/v3/custom?token=<DIFFBOT_TOKEN>' \
  --header 'Accept: application/json'
json
[
  {
    "api": "/api/article",
    "urlPattern": "(http(s)?://)?(.*\\.)?www.diffbot.com.*",
    "testUrl": "https://www.diffbot.com/insights/build-a-sanctions-tracker/",
    "rules": [
      {
        "name": "author",
        "selector": ".mb-1.text-dark strong"
      }
    ]
  }
]

API Definition

Generated from v1.1.0 of the Extract APIs OpenAPI specification.

Get all the Custom APIs and their rules currently defined on your token

Request

Authentication
tokenquery
Cache and insert token into example requests (15d expiry)

Example request

bash
curl --request GET \
  --url 'https://api.diffbot.com/v3/custom?token=<DIFFBOT_TOKEN>' \
  --header 'Accept: application/json'

Response

200Successful API Response
notesstring[]
xForwardHeadersobject
X-Evaluatestring
rulesobject[]
namestring
selectorstring
apistring
urlPatternstring
testUrlstring
500Internal Server Error
errorCodeinteger
errorstring
json
{
  "errorCode": 500,
  "error": "Internal Server Error"
}