Predicta
Search
Docs
Ctrl KPredicta SearchGet an API key
API reference

Events

Each event is a block of id, event and data lines followed by a blank line. id starts at 0 and increases by 1; data is one line of JSON.
0result{"network":"strava","data":[…]}
1source_error{"network":"hudsonrock","reason":"source_error"}
2result{"network":"github","data":[…]}
3progress{"done":94,"total":1840,"found":68,"failed":4}
: pingafter 15 s of silence
⋮
615done{"found":379,"failed":113,"credit_debited":true,"credit_balance":974}

result A source found something

networkstring
The source.
dataobject[]
The profiles found, in the same format as the items of v1's response. Their fields depend on the source.
result
{
  "network": "github",
  "data": [
    {
      "username": "johndoe",
      "platform": "github",
      "link": "https://github.com/johndoe",
      "user_id": "1234567"
    }
  ]
}

source_error A source could not answer

The search goes on with the other sources.

networkstring
The source.
reasonenum<string>

timeout: the source took too long.

unavailable: the source could not be reached, or answered with an error status.

invalid_response: the source answered something unreadable.

source_error: the source reported an error.

progress Every 5 seconds

doneinteger
Sources that have answered so far, with or without results. Use done / total for a progress bar.
totalinteger
Sources queried in all.
foundinteger
Sources that found something.
failedinteger
Sources that could not answer.

done Last event: the search is complete

Every source has answered or failed.

foundinteger
Sources that found something.
failedinteger
Sources that could not answer.
credit_debitedboolean
true if the credit was spent; false if it was refunded because no source could answer.
credit_balanceinteger
Your balance after the search.

failed Last event: the search was interrupted

Its credit is refunded. The results already sent are valid but incomplete.

reasonenum<string>
Why the search stopped, below.
credit_refundedboolean
Always true.
credit_balanceinteger
Your balance after the refund.
reasonMeaningWhat to do
shutdownOur server restarted during the searchStart the search again
orphanedOur server stopped unexpectedly during the searchStart the search again
max_durationThe search ran for more than 15 minutesStart the search again
internal_errorUnexpected error on our sideStart the search again; contact support if it persists
not_allowedThe person searched objected to the processing of their data (GDPR art. 21)Do not retry