Download field coverage reports for exported JSON and CSV results
When you execute a DQL query with thereport=1
parameter, DQL generates a report of the exported fields. For JSON exports, the report contains coverage for top-level json fields. For CSV exports, the report contains the coverage for each exported column. Reports are stored and can be accessed against a reportId
.
DQL reports are short-lived and expected to be downloaded with the result. They will be deleted 24 hours after the results are downloaded.
Reports are exported as CSV files with text/csv
mime type.
Accessing the report
You can access the report using the following endpoint:
https://kg.diffbot.com/kg/v3/dql/report/{reportId}?token={DIFFBOT-TOKEN}'
There are a few different ways to get the reportId
:
- The HTTP response header
X-Diffbot-CoverageReportId
contains thereportId
. - Download the report via same parameters of the DQL request. The following parameters should exactly match the original query:
- token
- query
- from
- size
- filter
- exportspec
- If the response format is
JSON
, thereportId
field is also present in the response JSON. Example:
{
"version": 3,
"hits": 242735030,
"results": 1,
"kgversion": "274",
"reportId": "C-5567f9e3-86b1",
...
}
Export Format
The coverage report is exported as a CSV