Get started with the Semilattice Node.js SDK
Get your API key
Install
Initialise the client
Choose a population model
Click to copy the population model's ID
Simulate an answer
answers.simulate
method simulates how this population would answer a question. Below, we are simulating how this population would respond to the question “Tech debt or unclear error messages, what’s worse?”.Handle the response
status
field set to “Queued”:Poll for results
Queued
→ Running
→ Predicted
(or potentially Failed
). Predictions typically take less than a minute.Poll for the result using the answer ID:View the results
simulated_answer_percentages
field will contain the prediction results:simulated_answer_percentages
object shows the predicted percentage of the population that would choose each answer option. In this example, 54.88% would choose “Tech debt” and 45.12% would choose “Unclear error messages”.