Headers
Path Parameters
ID of the prediction you want to fetch.
import Semilattice from 'semilattice';
const client = new Semilattice({
apiKey: 'My API Key',
});
const predictionResponse = await client.predictions.get('prediction_id');
console.log(predictionResponse.data);
{
"data": {
"id": "b8b3e8cb-4c67-40d7-8350-3eac3c2b127d",
"batch": "1e6bfe22-40d9-46c4-b241-9e1d7d5c5560",
"created_at": "2025-06-23T15:40:52Z",
"prediction_started_at": "2025-06-23T15:41:02Z",
"prediction_finished_at": "2025-06-23T15:43:56Z",
"population": "af8917b4-a09c-41f9-9c9f-c4c40c1f7415",
"simulation_engine": "answers-1",
"status": "Predicted",
"public": false,
"answer_options": [
"Tech debt",
"Unclear error messages"
],
"population_name": "Developers",
"question": "Tech debt or unclear error messages, what's worse?",
"question_options": {
"question_type": "single-choice"
},
"simulated_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"predicted_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}
Retrieves an answer prediction.
import Semilattice from 'semilattice';
const client = new Semilattice({
apiKey: 'My API Key',
});
const predictionResponse = await client.predictions.get('prediction_id');
console.log(predictionResponse.data);
{
"data": {
"id": "b8b3e8cb-4c67-40d7-8350-3eac3c2b127d",
"batch": "1e6bfe22-40d9-46c4-b241-9e1d7d5c5560",
"created_at": "2025-06-23T15:40:52Z",
"prediction_started_at": "2025-06-23T15:41:02Z",
"prediction_finished_at": "2025-06-23T15:43:56Z",
"population": "af8917b4-a09c-41f9-9c9f-c4c40c1f7415",
"simulation_engine": "answers-1",
"status": "Predicted",
"public": false,
"answer_options": [
"Tech debt",
"Unclear error messages"
],
"population_name": "Developers",
"question": "Tech debt or unclear error messages, what's worse?",
"question_options": {
"question_type": "single-choice"
},
"simulated_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
},
"predicted_answer_percentages": {
"Tech debt": 0.5488,
"Unclear error messages": 0.4512
}
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}
ID of the prediction you want to fetch.