API

This section is for developers. If you have not read Getting started yet, it says what Neuwo returns and how else it can reach your pages.

Two APIs

Each has its own token and base URL, and a token issued for one does not work on the other. Both are issued by Neuwo together with the endpoint URL: contact Neuwo or email adops@neuwo.ai, as there is no self-service signup.

Make your first call

One request to the EDGE API, with the token and the page you want analysed:

curl -H "origin: https://example.com" "YOUR_ENDPOINT/edge/GetAiTopics?token=YOUR_TOKEN&url=https://example.com/article"

Three things decide whether this works:

A 401 means the token is wrong or missing, and a 403 means the token is valid but is not allowed to do this.

To analyse text rather than a published page, post it to the Auto-Tagging API with its own token:

curl -X POST "https://napi.neuwo.ai/api/aitopics/GetAiTopics?token=YOUR_AUTO_TAGGING_TOKEN" \
  --data-urlencode "format=json" \
  --data-urlencode "headline=Cats: The Perfect Companion for Modern Living" \
  --data-urlencode "content=Cats make wonderful pets for modern households."

Read the response

Trimmed to one entry per block, this is the shape the Auto-Tagging API returns:

{
  "tags": [
    {
      "URI": "<https://tags.neuwo.ai/masterID101332>",
      "value": "Domestic Animals and Pets",
      "score": "0.79728"
    }
  ],
  "brand_safety": { "BS_score": "1.0", "BS_indication": "yes" },
  "marketing_categories": {
    "iab_tier_1": [{ "ID": "IAB16", "label": "Pets", "relevance": "0.54" }]
  },
  "smart_tags": [{ "ID": "123", "name": "animals-group" }]
}

Scores and relevances are strings, not numbers. Parse before you compare them.

If Neuwo could not analyse the page, the response carries an error message rather than any of these blocks.

Images

The Auto-Tagging API also classifies a picture. The address is the text endpoint with /image at the end, the token is the same, and image_url takes the place of content:

curl -X POST "https://napi.neuwo.ai/api/aitopics/GetAiTopics/image?token=YOUR_AUTO_TAGGING_TOKEN" \
  -d "image_url=https://example.com/images/wildfire.jpg" \
  -d "format=json"

Sentiment

On request, Neuwo adds a page-level sentiment to the answers of the Auto-Tagging API: whether the events a text reports are negative, neutral or positive, and how strongly. An obituary, an accident report or a match lost are negative; a product launch, an award or a match won are positive; reference, service and most factual news reporting are neutral, which is deliberately the wide default band.

It is a separate question from brand safety. An accident report is negative and brand-safe at the same time, and brand_safety keeps answering the safety question on its own.

Where it appears:

The call itself does not change. A routine piece of local news, sent as under Make your first call:

curl -X POST "https://napi.neuwo.ai/api/aitopics/GetAiTopics?token=YOUR_AUTO_TAGGING_TOKEN" \
  --data-urlencode "format=json" \
  --data-urlencode "headline=Council approves next year's road maintenance budget" \
  --data-urlencode "content=The city council approved next year's road maintenance budget on Tuesday. Resurfacing of the main street begins in May and is expected to take four months, with traffic diverted along the ring road during the work. Residents can follow the schedule on the city's website."

With sentiment switched on, the answer ends with the new object. Trimmed to the blocks you already know:

{
  "tags": [ … ],
  "brand_safety": { "BS_score": "1.0", "BS_indication": "yes" },
  "marketing_categories": { … },
  "smart_tags": [],
  "sentiment": {
    "label": "neutral",
    "score": 0.04,
    "model_version": "sentiment-model-v1"
  }
}

The same answer as XML ends with the three elements before the closing tag:

<rsp version="1.0">
  …
  <sentiment_label>neutral</sentiment_label>
  <sentiment_score>0.04</sentiment_score>
  <sentiment_model_version>sentiment-model-v1</sentiment_model_version>
</rsp>

Reference

Every endpoint, parameter and response, with a request builder.

API reference

SDKs

Per-endpoint code samples for each SDK are shown inside the reference next to the endpoint they belong to. These pages cover installation, authentication and a full walkthrough.

Moving from the previous address

An integration built against https://m1api.neuwo.ai moves to https://napi.neuwo.ai by changing its base URL. The token, the paths and the response are the same. What changes, and how to move.

API credentials

Paste the endpoint and token Neuwo issued you and every code sample on this site will show them instead of a placeholder. They stay in this browser, are never sent to Neuwo, and Clear removes them.

Select to set the value used in the code samples on this site.