Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. V1
  5. Content

Content

markdownView as Markdown

Content APIs for Lytics Content Affinity Engine, allow for

adding content into lytics, getting lists of content, and

understanding the content and content-topics.

**Content Classification**

Content classification refers to the Lytics automated

process of taking text, URL, image based content

and classifying it to attach topics to content documents.

* *Content* A list of content (URLs, Email Documents, Uploaded Documents, Campaigns) and

the topics, created dates, etc for each.

* *ContentTopics* Categories/Topics are applied to each piece of content.

* *User Content Affinity* Based on user interacting with content, the topics

(derived from the content they interact with) is enriched into their

profile.

First, an overview of How this content gets here.

* *Observed URLs* Once the lytics tag is on a Website, as users

use the website any new URL they interact with is collected.

* *Crawling* we can proactively crawl a site.

* *Email Tools* We see URLs inside of email campaigns and proactively classify

those URLs, as well as the emails themselves.

* *Uploaded Content* You may upload content to the **Classify**.

**Use Cases**

*1) User Content Recomendations* Find content for a user

based on their content-affinity.

*2) Get List of Content* Rich query api to get content.

**Examples**

``

# ad-hoc segment scan from content table

# get a list of content documents that

# - have aspects=article (aspects = article,product, etc)

# - has imageurl

curl -s -H "Authorization: $LIOKEY" \

-XGET "https://api.lytics.io/api/segment/scan?sortfield=created&limit=10" -d '

FILTER AND (

EXISTS imageurls

aspects = "article"

)

FROM content

' | jq '.'

# Create a content-segment

# - uses "ALIAS" as id for create/update, must be unique

curl -s -H "Authorization: $LIOKEY" -H "Content-Type: text/plain" \

-XPOST "$LIOAPI/api/segment" -d '

FILTER AND (

EXISTS imageurls

aspects = "article"

)

FROM content

WITH name = "My Articles"

ALIAS my_articles

' | jq '.'

# grab just those content-docs using named segment scan

curl -s -H "Authorization: $LIOKEY" \

-XGET "https://api.lytics.io/api/segment/my_articles/scan?sortfield=created&limit=10" \

| jq '.'

# grab recommended articles for single user

curl -s -H "Authorization: $LIODATAKEY" \

-XGET "https://api.lytics.io/api/content/recommend/:your_account_id/user/user_id/123456" \

| jq '.'

``

ContentTopics

GEThttps://api.lytics.io/api/content/topic

Get a list of topics in the content graph.

``

curl -s -H "Authorization: $LIOKEY" \

-XGET "https://api.lytics.io/api/content/topic?limit=10" | jq '.'

``

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839
{
  "status": 200,
  "message": "success",
  "data": [
    {
      "label": "Data-First Marketing",
      "doc_count": 275,
      "total": 380636,
      "missing": 216048,
      "present": 143710,
      "avg": 0.5983867964798089,
      "tags": [
        "custom"
      ]
    },
    {
      "label": "User Data Unification",
      "doc_count": 273,
      "total": 380636,
      "missing": 216048,
      "present": 154068,
      "avg": 0.6036863622558337,
      "tags": [
        "custom"
      ]
    },
    {
      "label": "Customer Data Platform",
      "doc_count": 313,
      "total": 380260,
      "missing": 216043,
      "present": 159628,
      "avg": 0.9704200631406573,
      "tags": [
        "custom"
      ]
    }
  ]
}

ContentTopicSummary

GEThttps://api.lytics.io/api/content/topic/{topic}


Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031
{
  "status": 200,
  "message": "success",
  "data": {
    "topics": {
      "total": 3232717,
      "missing": 2985477,
      "present": 239239,
      "bucket_none": 8001,
      "bucket_low": 26279,
      "bucket_mid": 11742,
      "bucket_high": 201218,
      "avg": 0.90787879293533
    },
    "docs": {
      "total": 373,
      "urls": [
        {
          "url": "www.our-site.com/product/new-product-xyz",
          "title": "Blue Running Shoes that make you faster",
          "topics": [
            "our-site (company)",
            "running",
            "shoes"
          ],
          "id": "3395466611293777389"
        }
      ]
    }
  }
}

ContentTopicRollupSummary

GEThttps://api.lytics.io/api/content/rollup/{label}


Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
{
  "data": {
    "docs": {
      "total": 2,
      "urls": [
        {
          "author": "Cookie Monster",
          "created": "2016-01-14T08:39:01.354824186-07:00",
          "description": "you should definitely make these cookies",
          "fetched": "2016-07-19T13:39:20.158747984-04:00",
          "id": "4525087172572165639",
          "meta": [
            "og:locale/en_US"
          ],
          "primary_image": "http://cookdiary.net/wp-content/uploads/images/Oatmeal-Chocolate-Chip-Cookies_1441.jpg",
          "stream": "default",
          "title": "how to make some cookies",
          "topic_relevances": {
            "Recipe": 0.64,
            "baking": 0.75
          },
          "topic_rollups": {
            "Things": 0.75
          },
          "topics": [
            "baking",
            "Recipe"
          ],
          "updated": "2016-07-19T13:34:18-04:00",
          "url": "www.recipes.com/chocolate-chip-cookies"
        },
        {
          "author": "The Swedish Chef",
          "created": "2016-07-19T13:39:20.158747984-04:00",
          "description": "a delicious cake",
          "id": "-2119104978705508335",
          "primary_image": "http://www.vanillacake.com/cake.jpg",
          "stream": "default",
          "title": "Basic Vanilla Cake Recipe",
          "topic_relevances": {
            "Recipe": 0.64,
            "baking": 0.85
          },
          "topic_rollups": {
            "Desserts": 0.85
          },
          "topics": [
            "Recipe",
            "baking"
          ],
          "updated": "2016-07-19T13:29:18-04:00",
          "url": "www.recipes.com/cake"
        }
      ]
    },
    "rollups": null
  },
  "message": "success",
  "status": 200
}

ContentTopicRollupList

GEThttps://api.lytics.io/api/content/topicrollup

Get list of topic-rollups.

``

curl "$LIOAPI/api/content/topicrollup" -s -H "Authorization: $LIOKEY" | jq '.'

``

Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "data": [
    {
      "id": "6a7f76ff97ad0e3e96c162f74aee8f8f",
      "account_id": "4f7b525bdba058fc096757a6",
      "label": "Baking rollup",
      "created": "2014-08-04T21:18:20.124Z",
      "updated": "2014-08-04T21:18:20.124Z",
      "topics": [
        {
          "label": "Recipe",
          "value": 0.66
        },
        {
          "label": "baking",
          "value": 0.55
        }
      ]
    }
  ]
}

Content Topic Blacklist Fetch

GEThttps://api.lytics.io/api/content/topicblocklist

Fetch the blacklisted topics

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728
{
  "status": 200,
  "message": "success",
  "data": [
    {
      "label": "Data-First Marketing",
      "doc_count": 275,
      "total": 380636,
      "missing": 216048,
      "present": 143710,
      "avg": 0.5983867964798089,
      "tags": [
        "blacklisted"
      ]
    },
    {
      "label": "User Data Unification",
      "doc_count": 273,
      "total": 380636,
      "missing": 216048,
      "present": 154068,
      "avg": 0.6036863622558337,
      "tags": [
        "blacklisted"
      ]
    }
  ]
}

Content Topic Blacklist Create

POSThttps://api.lytics.io/api/content/topicblocklist

Blacklist or un-blacklist topics to an account's topic-blacklist

``

# to blacklist certain topics

curl -s -XPOST "https://api.lytics.io/api/content/topicblocklist" \

-H "Content-type: application/json" \

-H "Authorization: $LIOKEY" \

-d'

{

"method": "add",

"ids": ["Data-First Marketing", "User Data Unification"]

}

' | jq '.'

# to unblacklist certain topics

curl -s -XPOST "https://api.lytics.io/api/content/topicblocklist" \

-H "Content-type: application/json" \

-H "Authorization: $LIOKEY" \

-d'

{

"method": "delete",

"ids": ["Data-First Marketing", "User Data Unification"]

}

' | jq '.'

``

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728
{
  "status": 200,
  "message": "success",
  "data": [
    {
      "label": "Data-First Marketing",
      "doc_count": 275,
      "total": 380636,
      "missing": 216048,
      "present": 143710,
      "avg": 0.5983867964798089,
      "tags": [
        "blacklisted"
      ]
    },
    {
      "label": "User Data Unification",
      "doc_count": 273,
      "total": 380636,
      "missing": 216048,
      "present": 154068,
      "avg": 0.6036863622558337,
      "tags": [
        "blacklisted"
      ]
    }
  ]
}

Content Topic Blacklist Update

PUThttps://api.lytics.io/api/content/topicblocklist

Replace topics in an account's topic-blacklist

``

curl -s -XPOST "https://api.lytics.io/api/content/topicblocklist" \

-H "Content-type: application/json" \

-H "Authorization: $LIOKEY" \

-d'

{

"ids": ["Data-First Marketing", "User Data Unification"]

}

' | jq '.'

``

Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728
{
  "status": 200,
  "message": "success",
  "data": [
    {
      "label": "Data-First Marketing",
      "doc_count": 275,
      "total": 380636,
      "missing": 216048,
      "present": 143710,
      "avg": 0.5983867964798089,
      "tags": [
        "blacklisted"
      ]
    },
    {
      "label": "User Data Unification",
      "doc_count": 273,
      "total": 380636,
      "missing": 216048,
      "present": 154068,
      "avg": 0.6036863622558337,
      "tags": [
        "blacklisted"
      ]
    }
  ]
}

ContentTopicRollup Fetch

GEThttps://api.lytics.io/api/content/topicrollup/{id}

Fetch a topic-rollup by **id**

Sample Response
Status|200 OK
12345678910111213141516171819
{
  "data": {
    "id": "6a7f76ff97ad0e3e96c162f74aee8f8f",
    "account_id": "4f7b525bdba058fc096757a6",
    "label": "Baking rollup",
    "created": "2014-08-04T21:18:20.124Z",
    "updated": "2014-08-04T21:18:20.124Z",
    "topics": [
      {
        "label": "Recipe",
        "value": 0.66
      },
      {
        "label": "baking",
        "value": 0.55
      }
    ]
  }
}

ContentTopicRollup Create

POSThttps://api.lytics.io/api/content/topicrollup/{id}

Create a topic-rollup.

``

curl -s -XPOST "https://api.lytics.io/api/content/topicrollup" \

-H "Content-type: application/json" \

-H "Authorization: $LIOKEY" \

-d'

{

"label": "Baking rollup",

"acctid": "123456",

"topics": [

{"label": "Recipe"},

{"label": "baking"}

]

}

' | jq '.'

``

Sample Response
Status|201 Created
12345678910111213141516171819
{
  "data": {
    "id": "6a7f76ff97ad0e3e96c162f74aee8f8f",
    "account_id": "4f7b525bdba058fc096757a6",
    "label": "Baking rollup",
    "created": "2014-08-04T21:18:20.124Z",
    "updated": "2014-08-04T21:18:20.124Z",
    "topics": [
      {
        "label": "Recipe",
        "value": 0.66
      },
      {
        "label": "baking",
        "value": 0.55
      }
    ]
  }
}

ContentTopicRollup Delete

DELETEhttps://api.lytics.io/api/content/topicrollup/{id}

Delete a topic-rollup

Sample Response
Status|204 No Content
1
No Content

ContentDocument

GEThttps://api.lytics.io/api/content/doc


Sample Response
Status|200 OK
12345678910111213141516171819
{
  "status": 200,
  "message": "success",
  "data": {
    "total": 1,
    "urls": [
      {
        "url": "www.our-site.com/product/new-product-xyz",
        "title": "Blue Running Shoes that make you faster",
        "topics": [
          "our-site (company)",
          "running",
          "shoes"
        ],
        "id": "3395466611293777389"
      }
    ]
  }
}

Content Classify

GEThttps://api.lytics.io/api/content/doc/classify

Classify a document without adding the document to the content table corpus. Used for debugging.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
{
  "data": {
    "id": "https://www.getlytics.com/blog/post/improving_google_analytics?utm_source=linkedin",
    "url": {
      "Params": {},
      "Utm": {
        "utm_campaign": null,
        "utm_content": null,
        "utm_medium": null,
        "utm_source": "linkedin",
        "utm_term": null
      },
      "UserInfo": null
    },
    "url_redirected_from": "",
    "description": "Stop Pretending Your Insights Are Actionable: Part 1, Google Analytics",
    "long_description": "Most analytics tools are used purely for insight discovery rather than empowering action. We explore how the Lytics analytics integrations focus on action and filling the some massive gaps traditional analytics tools miss.",
    "type": "web",
    "stream": "",
    "httpstatus": 0,
    "humanLanguage": "en",
    "tags": [
      {
        "type": "meta",
        "id": "og:title",
        "value": "stop pretending your insights are actionable: part 1, google analytics",
        "source": "meta",
        "vocab": "lytics",
        "relevance": 1
      },
      {
        "type": "concept",
        "id": "Google_Analytics",
        "tax": [
          "http://dbpedia.org/ontology/Company",
          "http://dbpedia.org/ontology/Website",
          "http://dbpedia.org/ontology/Work",
          "http://www.w3.org/2002/07/owl#Thing"
        ],
        "value": "Google Analytics",
        "source": "diffbot",
        "vocab": "dbpedia",
        "relevance": 0.95
      }
    ],
    "flags": null,
    "images": [
      {
        "url": "https://www.getlytics.com/img/blog/defaults/developers.gif"
      }
    ],
    "primary_image": "https://www.getlytics.com/img/blog/defaults/developers.gif",
    "videos": null,
    "primary_video": "",
    "published": "2015-10-23T00:00:00Z",
    "author": "Mark Hayden",
    "numpages": 0,
    "sitename": "Lytics",
    "productDescription": "",
    "brand": "",
    "price": "",
    "saveAmount": "",
    "productId": "",
    "created": "2016-06-24T21:20:43.421892991Z",
    "fetched": "2016-06-24T21:20:45.751844316Z",
    "updated": "2016-06-24T21:20:52.367247963Z",
    "enriched": {
      "diffbot": "2016-06-24T21:20:52.367248438Z",
      "google": "1970-01-01T00:00:00Z",
      "meta": "2016-06-24T21:20:45.751852586Z",
      "textrazor": "1970-01-01T00:00:00Z"
    },
    "version": 4
  },
  "message": "success",
  "status": 200
}

Content Classify

POSThttps://api.lytics.io/api/content/doc/classify

Classify a document and add the document to the content table corpus.

Sample Response
Status|200 OK
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
{
  "data": {
    "id": "https://www.getlytics.com/blog/post/improving_google_analytics?utm_source=linkedin",
    "url": {
      "Params": {},
      "Utm": {
        "utm_campaign": null,
        "utm_content": null,
        "utm_medium": null,
        "utm_source": "linkedin",
        "utm_term": null
      },
      "UserInfo": null
    },
    "url_redirected_from": "",
    "description": "Stop Pretending Your Insights Are Actionable: Part 1, Google Analytics",
    "long_description": "Most analytics tools are used purely for insight discovery rather than empowering action. We explore how the Lytics analytics integrations focus on action and filling the some massive gaps traditional analytics tools miss.",
    "type": "web",
    "stream": "",
    "httpstatus": 0,
    "humanLanguage": "en",
    "tags": [
      {
        "type": "meta",
        "id": "og:title",
        "value": "stop pretending your insights are actionable: part 1, google analytics",
        "source": "meta",
        "vocab": "lytics",
        "relevance": 1
      },
      {
        "type": "concept",
        "id": "Google_Analytics",
        "tax": [
          "http://dbpedia.org/ontology/Company",
          "http://dbpedia.org/ontology/Website",
          "http://dbpedia.org/ontology/Work",
          "http://www.w3.org/2002/07/owl#Thing"
        ],
        "value": "Google Analytics",
        "source": "diffbot",
        "vocab": "dbpedia",
        "relevance": 0.95
      }
    ],
    "flags": null,
    "images": [
      {
        "url": "https://www.getlytics.com/img/blog/defaults/developers.gif"
      }
    ],
    "primary_image": "https://www.getlytics.com/img/blog/defaults/developers.gif",
    "videos": null,
    "primary_video": "",
    "published": "2015-10-23T00:00:00Z",
    "author": "Mark Hayden",
    "numpages": 0,
    "sitename": "Lytics",
    "productDescription": "",
    "brand": "",
    "price": "",
    "saveAmount": "",
    "productId": "",
    "created": "2016-06-24T21:20:43.421892991Z",
    "fetched": "2016-06-24T21:20:45.751844316Z",
    "updated": "2016-06-24T21:20:52.367247963Z",
    "enriched": {
      "diffbot": "2016-06-24T21:20:52.367248438Z",
      "google": "1970-01-01T00:00:00Z",
      "meta": "2016-06-24T21:20:45.751852586Z",
      "textrazor": "1970-01-01T00:00:00Z"
    },
    "version": 4
  },
  "message": "success",
  "status": 200
}

Content Recommendation

GEThttps://api.lytics.io/api/content/recommend/user/{fieldname}/{fieldval}


Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
{
  "data": [
    {
      "url": "www.getlytics.com/blog/post/intent_through_content",
      "title": "Understanding User Intent Through Content",
      "description": "Customer Intent comes from understanding the connection between engagement and its contexts. Content modeling and affinity graphs makes interpretation of intent a lot easier. Learn how marketers can benefit from this.",
      "topics": [
        "customer data platform",
        "data science",
        "content marketing",
        "personalization"
      ],
      "topic_relevances": {
        "content marketing": 1,
        "customer data platform": 1,
        "data science": 1,
        "personalization": 1
      },
      "primary_image": "https://www.getlytics.com/img/blog/posts/intent_through_content/intent_through_content-bg.gif",
      "author": "",
      "created": "2016-06-08T16:11:45.599594093Z",
      "id": "-3435113786560588929",
      "sitename": "Lytics",
      "stream": "default",
      "path": [
        "blog",
        "blog/post",
        "blog/post/intent_through_content"
      ],
      "aspects": [
        "article"
      ],
      "language": "unknown",
      "updated": "2016-06-09T12:49:36.870359765Z",
      "fetched": "2016-06-09T12:49:35.812654441Z",
      "meta": [
        "og:locale/en_us",
        "og:site_name/lytics",
        "og:title/understanding user intent through content",
        "og:type/article",
        "og:url/https://www.getlytics.com/blog/post/intent_through_content"
      ],
      "confidence": 0.5916079783099615,
      "visited": true
    }
  ],
  "message": "success",
  "status": 200
}

Content Segment Recommendation

GEThttps://api.lytics.io/api/content/recommend/segment/{segId}


Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
{
  "data": [
    {
      "url": "www.getlytics.com/blog/post/intent_through_content",
      "title": "Understanding User Intent Through Content",
      "description": "Customer Intent comes from understanding the connection between engagement and its contexts. Content modeling and affinity graphs makes interpretation of intent a lot easier. Learn how marketers can benefit from this.",
      "topics": [
        "customer data platform",
        "data science",
        "content marketing",
        "personalization"
      ],
      "topic_relevances": {
        "content marketing": 1,
        "customer data platform": 1,
        "data science": 1,
        "personalization": 1
      },
      "primary_image": "https://www.getlytics.com/img/blog/posts/intent_through_content/intent_through_content-bg.gif",
      "author": "",
      "created": "2016-06-08T16:11:45.599594093Z",
      "id": "-3435113786560588929",
      "sitename": "Lytics",
      "stream": "default",
      "path": [
        "blog",
        "blog/post",
        "blog/post/intent_through_content"
      ],
      "aspects": [
        "article"
      ],
      "language": "unknown",
      "updated": "2016-06-09T12:49:36.870359765Z",
      "fetched": "2016-06-09T12:49:35.812654441Z",
      "meta": [
        "og:locale/en_us",
        "og:site_name/lytics",
        "og:title/understanding user intent through content",
        "og:type/article",
        "og:url/https://www.getlytics.com/blog/post/intent_through_content"
      ],
      "confidence": 0.5916079783099615,
      "visited": true
    }
  ],
  "message": "success",
  "status": 200
}

Public Content Recommendation

GEThttps://api.lytics.io/api/content/recommend/{account}/user/{fieldname}/{fieldval}


Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
{
  "data": [
    {
      "url": "www.getlytics.com/blog/post/intent_through_content",
      "title": "Understanding User Intent Through Content",
      "description": "Customer Intent comes from understanding the connection between engagement and its contexts. Content modeling and affinity graphs makes interpretation of intent a lot easier. Learn how marketers can benefit from this.",
      "topics": [
        "customer data platform",
        "data science",
        "content marketing",
        "personalization"
      ],
      "topic_relevances": {
        "content marketing": 1,
        "customer data platform": 1,
        "data science": 1,
        "personalization": 1
      },
      "primary_image": "https://www.getlytics.com/img/blog/posts/intent_through_content/intent_through_content-bg.gif",
      "author": "",
      "created": "2016-06-08T16:11:45.599594093Z",
      "id": "-3435113786560588929",
      "sitename": "Lytics",
      "stream": "default",
      "path": [
        "blog",
        "blog/post",
        "blog/post/intent_through_content"
      ],
      "aspects": [
        "article"
      ],
      "language": "unknown",
      "updated": "2016-06-09T12:49:36.870359765Z",
      "fetched": "2016-06-09T12:49:35.812654441Z",
      "meta": [
        "og:locale/en_us",
        "og:site_name/lytics",
        "og:title/understanding user intent through content",
        "og:type/article",
        "og:url/https://www.getlytics.com/blog/post/intent_through_content"
      ],
      "confidence": 0.5916079783099615,
      "visited": true
    }
  ],
  "message": "success",
  "status": 200
}

Content Taxonomy

GEThttps://api.lytics.io/api/content/taxonomy


Sample Response
Status|200 OK
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
{
  "data": {
    "n": 438,
    "nodes": [
      {
        "name": "marketing technology",
        "doc_count": 2
      },
      {
        "name": "AdWords",
        "doc_count": 1
      },
      {
        "name": "ad retargeting",
        "doc_count": 4
      },
      {
        "name": "analytics",
        "doc_count": 2
      },
      {
        "name": "customer service",
        "doc_count": 1
      },
      {
        "name": "data visualization",
        "doc_count": 2
      },
      {
        "name": "data-first marketing",
        "doc_count": 157
      },
      {
        "name": "personalization",
        "doc_count": 15
      }
    ],
    "links": [
      {
        "source": 66,
        "target": 54,
        "value": 0.375
      },
      {
        "source": 66,
        "target": 75,
        "value": 0.25
      },
      {
        "source": 66,
        "target": 37,
        "value": 0.25
      }
    ]
  },
  "message": "success",
  "status": 200
}

Content Corpus

POSThttps://api.lytics.io/api/content/corpus

Add a document to the content table corpus. Either a URL or text must be provided.

This allows entry of documents/content that get added to content

table, content-graph and available for usage in recommendation, as

well as content-explorer.

* **id** if you upload the document more than once, ensure it has common id so only one document is created

* **Custom Attributes** Any attributes you upload that are not reserved, will be added to content document.

``sh

# Upsert a document into content table and classify it

curl -s -XPOST "https://api.lytics.io/api/content/corpus" \

-H "Authorization: $LIOKEY" \

-H "Content-Type: application/json" \

-d '{

"id":"doc_id_123",

"text":"big-long-body-of text for classification",

"custom_attribute_name":"custom attribute"

}' | jq '.'

# upsert a url into db

# url is used as document id

curl -s -XPOST "https://api.lytics.io/api/content/corpus" \

-H "Authorization: $LIOKEY" \

-H "Content-Type: application/json" \

-d '{

"url":"http://www.validdomain/validurl.html",

"custom_attribute_name":"custom attribute"

}' | jq '.'

``

Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "status": 200,
  "message": "success",
  "data": {
    "body": [
      "here is some body text"
    ],
    "source": [
      "upload"
    ],
    "updated": [
      "2016-09-13 21:59:38.551972802 -0400 EDT"
    ],
    "url": [
      "http://www.google.com/"
    ],
    "version": [
      "4"
    ]
  }
}

Content Plot

GEThttps://api.lytics.io/api/content/filter/topic


Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "status": 200,
  "message": "success",
  "data": {
    "segment_id": "34a492e518b117228954e0bd8a7cfda7",
    "collections": [
      {
        "field": "int_score_momentum",
        "name": "do_more",
        "points": [
          {
            "topic": "guerrilla marketing",
            "value": 41.411764705882,
            "avg_affinity": 0.58597826180251,
            "doc_ct": 27
          }
        ]
      }
    ]
  }
}

Topic Add

POSThttps://api.lytics.io/api/content/doc/{docField}/{docId}/topic/{topicLabel}

Add a topic to a Document.

Sample Response
Status|200 OK
123456789101112131415161718192021222324252627282930
{
  "status": 200,
  "message": "success",
  "data": {
    "author": "Cookie Monster",
    "created": "2016-01-14T08:39:01.354824186-07:00",
    "description": "you should definitely make these cookies",
    "fetched": "2016-07-19T13:39:20.158747984-04:00",
    "id": "4525087172572165639",
    "meta": [
      "og:locale/en_US"
    ],
    "primary_image": "http://cookdiary.net/wp-content/uploads/images/Oatmeal-Chocolate-Chip-Cookies_1441.jpg",
    "stream": "default",
    "title": "how to make some cookies",
    "topic_relevances": {
      "Recipe": 0.64,
      "baking": 0.75
    },
    "topic_rollups": {
      "Things": 0.75
    },
    "topics": [
      "baking",
      "Recipe"
    ],
    "updated": "2016-07-19T13:34:18-04:00",
    "url": "www.recipes.com/chocolate-chip-cookies"
  }
}

Topic Remove

DELETEhttps://api.lytics.io/api/content/doc/{docField}/{docId}/topic/{topicLabel}


Sample Response
Status|204 No Content
1
No Content

Content Crawl

POSThttps://api.lytics.io/api/content/crawl

Create a new crawl for an account

Sample Response
Status|200 OK
1
null

Content Metrics

GEThttps://api.lytics.io/api/content/metrics

Fetch the Account content Metrics.

Sample Response
Status|200 OK
12345678910111213
{
  "data": {
    "total": 215590,
    "nokeys": 0,
    "nocontent": 144430,
    "noclassifiedcontent": 53537,
    "noaffinities": 0,
    "errors": 0,
    "success": 17623
  },
  "message": "success",
  "status": 200
}

Content Topic Clusters

GEThttps://api.lytics.io/api/content/topic/cluster

Get a collection of the most central topics in account's topic graph, with each topic's corresponding cluster. This endpoint is meant

to be used as a means to experiment with the limit, direction, penalty, and threshold parameters to create a set of clusters

that encompass meaningful topics and the coverage of topics that these clusters SUMMIZE in terms of relative centrality. Once values

for those parameters yield a set of optimal clusters, they should be sent to the topic clusters POST endpoint to create topic rollups.

Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "data": {
    "clusters": [
      [
        "Baking",
        "Cakes",
        "Cupakes",
        "Cookies"
      ],
      [
        "Grilling",
        "Beef",
        "Chicken",
        "Steak"
      ]
    ],
    "coverage": 0.2062
  },
  "message": "success",
  "status": 200
}

Create Content Topic Clusters

POSThttps://api.lytics.io/api/content/topic/cluster

Create a collection of the most central topics in an account's topic grah, with each topic's corresponding cluster.

Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "data": {
    "clusters": [
      [
        "Baking",
        "Cakes",
        "Cupakes",
        "Cookies"
      ],
      [
        "Grilling",
        "Beef",
        "Chicken",
        "Steak"
      ]
    ],
    "coverage": 0.2062
  },
  "message": "success",
  "status": 200
}

Content Topic Cluster

GEThttps://api.lytics.io/api/content/topic/cluster/{topicId}

Get topics that are related to an input topic.

This can be useful for creating topic rollups,

and provide initial suggestions as to which topics

might best comprise a rollup.

The options for direction, penalty and threshold

are currently adjustable. As we determine which

values produce the most useful clusters, we can set

better defaults for them.

Sample Response
Status|200 OK
123456789101112131415161718192021
{
  "data": {
    "clusters": [
      [
        "Baking",
        "Cakes",
        "Cupakes",
        "Cookies"
      ],
      [
        "Grilling",
        "Beef",
        "Chicken",
        "Steak"
      ]
    ],
    "coverage": 0.2062
  },
  "message": "success",
  "status": 200
}
Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

limitoptionalstring

limit on number of topics to return, default = 500

Example:

20

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

topicrequiredstring

id or slug of topic

Example:

stuff

Query Parameters

account_idoptionalstring

Your Lytics account ID.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

labelrequiredstring

label of topic-rollup

Example:

123abc

Query Parameters

account_idoptionalstring

Your Lytics account ID.

Headers

Authorizationoptionalstring

Hide Parameters

Headers

Authorizationoptionalstring

Hide Parameters

Headers

Authorizationoptionalstring

Hide Parameters

Headers

Authorizationoptionalstring

Hide Parameters

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

id of topic-rollup

Example:

123abc

Query Parameters

account_idoptionalstring

Your Lytics account ID.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

id of topic-rollup

Example:

123abc

Query Parameters

account_idoptionalstring

Your Lytics account ID.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

id of topic-rollup

Example:

123abc

Query Parameters

account_idoptionalstring

Your Lytics account ID.

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

urlsoptionalstring

url to look up

Example:

http//www.getlytics.com/blog/post
idsoptionalstring

hashed url or campaign id to look up

Example:

123abc

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

urloptionalstring

url to classify

Example:

http://myurl
textoptionalstring

text to classify

Example:

my text

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

urloptionalstring

url to classify

Example:

http://myurl
textoptionalstring

text to classify

Example:

my text

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

fieldnamerequiredstring

field to use to identify a user

Example:

email
fieldvalrequiredstring

unique identity

Example:

[email protected]

Query Parameters

account_idoptionalstring

Your Lytics account ID.

contentsegmentrequiredstring

id, or slug of a content-collection to filter content

Example:

blog_content
limitoptionalstring

limit on number of documents to suggest/return

Example:

20
shuffleoptionalstring

whether or not to shuffle the recommendation order

Example:

false
visitedoptionalstring

whether to show recommendations for content the user has already viewed

Example:

false
topicsoptionalstring

if supplied, only allow recommendations on content with the specified topics

Example:

["Marketing", "Analytics"]
rankoptionalstring

Ranking method for order of recommendations. Must be one of "popular", "recent", or "affinity"

Example:

affinity
waitoptionalstring

Whether or not to wait for more complex user identities to resolve

Example:

true
emailoptionalstring

if the fieldname and fieldval are omitted, an email can be provided. This can be helpful for templating use-cases

Example:

[email protected]
urloptionalstring

if url is provided, the recommendations will be based on the content topics associated with the provided URL

Example:

www.example.com

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

segIdrequiredstring

id, or slug of the user segment to recommend content

Example:

smt_power

Query Parameters

account_idoptionalstring

Your Lytics account ID.

contentsegmentoptionalstring

id, or slug of a content-collection segment to filter content

Example:

blog_content
limitoptionalstring

limit on number of documents to suggest/return

Example:

20
shuffleoptionalstring

whether or not to shuffle the recommendation order

Example:

false
rankoptionalstring

Ranking method for order of recommendations. Must be one of "popular", "recent", or "affinity"

Example:

affinity

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

accountrequiredstring

the account ID

Example:

123
fieldnamerequiredstring

field to use to identify a user

Example:

email
fieldvalrequiredstring

unique identity

Example:

[email protected]

Query Parameters

account_idoptionalstring

Your Lytics account ID.

contentsegmentrequiredstring

id, or slug of a content-collection to filter content

Example:

blog_content
limitoptionalstring

limit on number of documents to suggest/return

Example:

20
shuffleoptionalstring

whether or not to shuffle the recommendation order

Example:

false
visitedoptionalstring

whether to show recommendations for content the user has already viewed

Example:

false
topicsoptionalstring

if supplied, only allow recommendations on content with the specified topics

Example:

["Marketing", "Analytics"]
rankoptionalstring

Ranking method for order of recommendations. Must be one of "popular", "recent", or "affinity"

Example:

affinity
waitoptionalstring

Whether or not to wait for more complex user identities to resolve

Example:

true
emailoptionalstring

if the fieldname and fieldval are omitted, an email can be provided. This can be helpful for templating use-cases

Example:

[email protected]
urloptionalstring

if url is provided, the recommendations will be based on the content topics associated with the provided URL

Example:

www.example.com

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

limitoptionalstring

number of topics to include in the topic graph, capped at 500 topics

Example:

150
budgetoptionalstring

the depth at which any Monte Carlo simulation can traverse through the graph

Example:

1.0
iteroptionalstring

how many Monte Carlo simulations to run for each topic

Example:

8
rawoptionalstring

whether to generate the topic relationships from its Bayesian network

Example:

false
rawThresholdoptionalstring

when extracting relationships directly from the Bayesian network, the threshold at which to determine ties

Example:

0.7
cliquesoptionalstring

whether to return a single graph or an array of disjoint subgraphs

Example:

false
cliqueThresholdoptionalstring

when returning cliques, the threshold at which to determine if two cliques should be connected

Example:

0.0

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

urloptionalstring

the URL for identifying and retrieving content

Example:

http://www.somedomain.com/blog/great-post
textoptionalstring

the body of the content to be added

Example:

here is some body text
topicsoptionalstring

custom topics to append to the document, in addition to topics that will be added with enrichment

Example:

Data,Hockey

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

segment_idoptionalstring

fieldsoptionalstring

filtersoptionalstring

limitoptionalstring

limit to the number of results supplied if a filter is supplied

Example:

10

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

docFieldrequiredstring

name of field to look up content by

Example:

hashedurl
docIdrequiredstring

value of field to look up content by

Example:

123abc
topicLabelrequiredstring

name of topic to add

Example:

cats

Query Parameters

account_idoptionalstring

Your Lytics account ID.

relevanceoptionalstring

the relevance threshold to set for the new topic

Example:

0.5

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

docFieldrequiredstring

name of field to look up content by

Example:

hashedurl
docIdrequiredstring

value of field to look up content by

Example:

123abc
topicLabelrequiredstring

name of topic to add

Example:

cats

Query Parameters

account_idoptionalstring

Your Lytics account ID.

relevanceoptionalstring

the relevance threshold to set for the new topic

Example:

0.5

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

domainoptionalstring

the domain to use for the seed of the crawl

Example:

lytics.com
domainsoptionalstring

the domains to use for the seed of the crawl

Example:

["lytics.com"]

Headers

Authorizationoptionalstring

Hide Parameters

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

limitoptionalstring

number of label rollups to produce

Example:

8
directionoptionalstring

direction to follow topic dependencies, either "in" or "out"

Example:

out
penaltyoptionalstring

penalty to apply as traversal depth increases, where a lower value introduces a higher penalty

Example:

0.9
thresholdoptionalstring

threshold at which neighbor topics are determined, where a lower value introduces a more lenient rule

Example:

0.4

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

Your Lytics account ID.

limitoptionalstring

number of label rollups to produce

Example:

8
directionoptionalstring

direction to follow topic dependencies, either "in" or "out"

Example:

out
penaltyoptionalstring

penalty to apply as traversal depth increases, where a lower value introduces a higher penalty

Example:

0.9
thresholdoptionalstring

threshold at which neighbor topics are determined, where a lower value introduces a more lenient rule

Example:

0.4

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

topicIdrequiredstring

public topic label in the taxonomy

Example:

Pets

Query Parameters

account_idoptionalstring

Your Lytics account ID.

directionoptionalstring

direction to follow topic dependencies, either "in" or "out"

Example:

out
penaltyoptionalstring

penalty to apply as traversal depth increases, where a lower value introduces a higher penalty

Example:

0.9
thresholdoptionalstring

threshold at which neighbor topics are determined, where a lower value introduces a more lenient rule

Example:

0.4

Headers

Authorizationoptionalstring