Skip to content
English
  • There are no suggestions because the search field is empty.

User needs API

The purpose of this article is to describe API endpoints for user needs tagging of provided articles.

The service is a single API endpoint that takes the text of an article and returns its User Needs profile – the mix of reader needs the piece serves, expressed as scores, together with a short explanation of how the result was reached. It accepts one text at a time or several in a single batch.

Your credentials

API key XXXXXXXXXXXXXXXX
brandId XXXX

Please treat the API key as a secret and keep it server-side. It should never appear in browser code or in a public repository. Let us know if it needs to be rotated at any point.

The endpoint
POST https://api.smartocto.com/api/integrations/v2/<brandId>/ai/untagger  

Content-Type: application/json
Authorization: <your API key>

Replace <brandId> in the path with the value from the table above.

The request body

The body contains a single batch array. Each entry has one field, text, which you populate with the article content:

{   
"batch": [
{ "text": "Full text of the first article ..." },
{ "text": "Full text of the second article ..." }
]
}

Send the article body as plain text, without HTML markup. The more complete the text, the more reliable the result – a headline and a lead paragraph alone give the model very little to work with.

Usage limits – please observe these

  • Send at most five texts per batch.
  • Leave at least five seconds between consecutive requests.

If you need to process a larger archive in one go, please get in touch beforehand so we can plan it together rather than have the throughput limited unexpectedly.

A worked example

Taking a single article as input, in this case a fictional report for illustration:

https://www.example-news.org/world/harbour-city-reopens-rail-link/a-48217390

{   
"batch": [
{
"text": "Light rain falls as the first passenger train in more than a
decade pulls into Westhaven Central. The station, closed since the
regional dispute of 2014, reopened this week after an eighteen-month
reconstruction financed jointly by the national government and a
consortium of foreign lenders. For the roughly 240,000 residents of
the coastal province, the line restores a four-hour connection to the
capital that until now required a full day by road. Officials at the
ceremony framed the reopening as a test case. 'Infrastructure is the
least controversial place to begin,' said the regional transport
commissioner, who has spent two years negotiating with the
administrations on either side of the river. Not everyone shares the
optimism. Freight operators point out that the single track limits
capacity to six services a day, and that the rolling stock has been
leased rather than bought. Analysts note that the reconstruction
budget has already been revised twice, and that no agreement has yet
been reached on who maintains the line beyond the first three years."
}
]
}
The response
{
"request_id": "1790254219000",
"response": [
{
"response": {
"action_driven": {
"connect_me": 60,
"help_me": 40,
"score": 5
},
"context_driven": {
"educate_me": 42,
"give_me_perspective": 58,
"score": 41
},
"emotion_driven": {
"divert_me": 33,
"inspire_me": 67,
"score": 8
},
"explanation": "This article is primarily Fact-driven with
strong Context-driven elements. The author's dominant intention is to
report a concrete event, answering the classic who, what, where and
when questions around the reopening of the line. A substantial part of
the text is nevertheless devoted to background: the origin of the
dispute, how the reconstruction was financed, and the unresolved
questions around capacity and long-term maintenance. Within
Context-driven, 'Give me perspective' outweighs 'Educate me' because
the piece assumes familiarity with the underlying dispute and
concentrates instead on what the reopening means for the region and
its neighbors. Emotion-driven and Action-driven are both marginal: the
article makes no emotional appeal and offers the reader no practical
guidance or call to action.",
"fact_driven": {
"keep_me_engaged": 57,
"score": 46,
"update_me": 43
}
},
"status": "success"
}
],
"status": "success"
}
The fields returned

Every response contains the same eight sub-needs, grouped into four categories. These are the exact JSON field names to read:

JSON field User need What the reader wants
fact_driven – knowing what happened
update_me Update me To know what just happened
keep_me_engaged Keep me engaged To follow a story they are already invested in
context_driven – understanding it
educate_me Educate me To have the background explained from the ground up
give_me_perspective Give me perspective To understand what it means and why it matters
emotion_driven – feeling something
divert_me Divert me To be entertained or taken out of the everyday
inspire_me Inspire me To be moved, uplifted or given hope
action_driven – doing something with it
connect_me Connect me To feel part of a community or a wider conversation
help_me Help me To get practical advice they can act on

The table above follows the conceptual order of the model. In the JSON itself the keys are serialised alphabetically, which means score can appear between the two sub-needs rather than before them – as it does in fact_driven above. Please read the values by key name and never by position.

How to read the result

The output has two levels, and the distinction between them matters:

  • The four score values – one per category – describe the overall mix of the article and add up to 100. In the example above: fact 46, context 41, emotion 8, action 5.
  • Within each category, the two sub-needs are a split of that category alone, and also add up to 100. They do not describe the article as a whole.

The one thing worth internalising

A high sub-need percentage inside a low-scoring category is still small in absolute terms. In the example, inspire_me reads 67, but it is 67 % of a category worth only 8 – roughly 5 points of the article overall. To get the absolute weight of a sub-need, multiply it by its category score. Reading sub-need numbers on their own is the most common way these results get misinterpreted.

The explanation field is free text and is meant for humans reviewing the output, not for parsing. Its wording and length vary between requests, so please do not build logic on it. Where the explanation quotes figures of its own, treat them as part of the model's narrative reasoning – the authoritative values are always the numeric fields.

Batches and error handling

There are two levels of status in the response: one per item in the response array and one for the request as a whole. Please check the per-item status rather than only the outer one, since an individual text can fail while the rest of the batch succeeds.

The request_id identifies the call on our side. If a result looks wrong or a request fails, sending us that value along with your description lets us trace exactly what happened.

Trying it without writing code

The endpoint is available in our API explorer, which is the quickest way to get a feel for the output before integrating. Authorise with your API key and you can post texts directly from the browser:
https://apiexplorer.smartocto.com/#/ai/post__brandId__ai_untagger

We would suggest starting with a handful of articles whose User Needs profile your editors would recognise intuitively, and comparing the output against their judgement. It is the fastest way to build confidence in the scores before you run them at volume.