Search History
Apart from executing new searches, it is also possible to retrieve past searches by leveraging the API. In this section, you may learn how to use and consume the endpoints that are responsible for managing the data.
Using the Search History API
Normally, you would start by retrieving all the past searches you have executed. Don’t worry, this does not include the
actual search results. To do so, you may leverage the /v1/history endpoint with a simple GET request.
Request
GET https://api.intelsentry.io/v1/history
Authorization: Bearer <token>By parsing the response, you should be able to locate your desired search from the history and extract the id JSON key.
Once you have done so, you may now obtain the actual search results associated with the search by using the /v1/history/{search-id} endpoint.
Request
GET https://api.intelsentry.io/v1/history/7fe73e65-19ba-40c1-b83a-bf425976ee21
Authorization: Bearer <token>If you want, you may also issue a DELETE request on the same endpoint to delete the search from the history instead.
Request
DELETE https://api.intelsentry.io/v1/history/7fe73e65-19ba-40c1-b83a-bf425976ee21
Authorization: Bearer <token>You will not be able to recover this data, choose wisely!
Consuming the Search History API
Once you have selected the desired search id from the /v1/history endpoint. You may hit the /v1/history/{search-id} endpoint
to get your results back. If the id is correct and exists in your history, the API will respond in a similar format as the search endpoint.
HTTP/1.1 200
Content-Type: application/json
{
"status": 200,
"results": [
"https://login.example.com/:redacted@example.com:redacted",
"https://login.example.com/login.srf:redacted@gmail.com:redacted",
"https://account.example.com/ResetPassword.aspx:redacted:redacted.com123"
],
"results_count": 3
}With this, you will simply need to parse the results JSON key as a JSON array of strings, which contains each individual compromised credential.
For the ease of parsing and data manipulation, results_count corresponds to the length of the JSON string array.
In case the id is not correct, the API will respond back with a 400 Bad Request error.
HTTP/1.1 400
Content-Type: application/json
{
"status": 400,
"error": "Search not found in history"
}For further information, please review the technical API reference of the endpoints.