Introduction

The Lateral API

Pre-populated datasets

Tools

Sign-up for an API Key

News Recommender

Authentication

Every request must be authenticated with your subscription key. This must be sent as an HTTP header:

Subscription-Key: YOUR_KEY_HERE

Requests

All requests must be sent with a JSON body and with a JSON content type header:

Content-Type: application/json

404 Errors

When a request to a path not in the API is made, you will get the following error message:

{
  "message": "Not Found"
}

API Specification

  • Go
  • Java
  • Node.js
  • PHP
  • Python
  • Ruby
  • Shell

News

Similar to text/documents/similar-to-text

POST/documents/similar-to-textSimilar to text
Code Sample

Returns recommendations of documents from the corpus that are similar to the given text.

Parameters
Name Example Description
text(string, required) testing The text to get recommendations for
Response200

The recommendations, text has been truncated here for display purposes.

Response (200)
[
  {
    "document_id": "452428",
    "similarity": 0.91413,
    "title": "Adventures in Piano Building (medium.com)",
    "url": "https://medium.com/@hackmancoltaire/adventures-in-piano-building-c3fe5fa0b56b",
    "published": "2014-12-24T12:00:01.000Z",
    "author": null,
    "image": "https://d262ilb51hltx0.cloudfront.net/max/800/1*uTAT1bayI6ek6esb-BcZhg.jpeg",
    "thumbnail": "https://images.getnewsbot.com/452428.jpg",
    "summary": "Turning a mouse [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  },
  {
    "document_id": "820199",
    "similarity": 0.901011,
    "title": "How to create a handheld Linux terminal (n-o-d-e.net)",
    "url": "http://n-o-d-e.net/post/107977286006/how-to-create-a-handheld-linux-terminal",
    "published": "2015-01-13T04:10:02.000Z",
    "author": null,
    "image": "http://i.imgur.com/02W1NlK.png",
    "thumbnail": "https://images.getnewsbot.com/820199.jpg",
    "summary": "Cram everything into [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  },
  {
    "document_id": "1371617",
    "similarity": 0.874432,
    "title": "Building Pulse and Bloom: An Interactive Biofeedback Installation (ofbrooklyn.com)",
    "url": "http://www.ofbrooklyn.com/2014/09/6/building-pulse-bloom-biofeedback-burning-man-2014/",
    "published": "2015-01-28T10:20:01.000Z",
    "author": null,
    "image": null,
    "thumbnail": false,
    "summary": "// State: resting void [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  }
]

Similar to document/documents/:id/similar

GET/documents/:id/similarSimilar to document
Code Sample

Returns recommendations of documents from the corpus that are similar to the given id.

Response200

The recommendations, text has been truncated here for display purposes.

Response (200)
[
  {
    "document_id": "452428",
    "similarity": 0.91413,
    "title": "Adventures in Piano Building (medium.com)",
    "url": "https://medium.com/@hackmancoltaire/adventures-in-piano-building-c3fe5fa0b56b",
    "published": "2014-12-24T12:00:01.000Z",
    "author": null,
    "image": "https://d262ilb51hltx0.cloudfront.net/max/800/1*uTAT1bayI6ek6esb-BcZhg.jpeg",
    "thumbnail": "https://images.getnewsbot.com/452428.jpg",
    "summary": "Turning a mouse [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  },
  {
    "document_id": "820199",
    "similarity": 0.901011,
    "title": "How to create a handheld Linux terminal (n-o-d-e.net)",
    "url": "http://n-o-d-e.net/post/107977286006/how-to-create-a-handheld-linux-terminal",
    "published": "2015-01-13T04:10:02.000Z",
    "author": null,
    "image": "http://i.imgur.com/02W1NlK.png",
    "thumbnail": "https://images.getnewsbot.com/820199.jpg",
    "summary": "Cram everything into [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  },
  {
    "document_id": "1371617",
    "similarity": 0.874432,
    "title": "Building Pulse and Bloom: An Interactive Biofeedback Installation (ofbrooklyn.com)",
    "url": "http://www.ofbrooklyn.com/2014/09/6/building-pulse-bloom-biofeedback-burning-man-2014/",
    "published": "2015-01-28T10:20:01.000Z",
    "author": null,
    "image": null,
    "thumbnail": false,
    "summary": "// State: resting void [...]",
    "source_name": "Hacker News",
    "source_slug": "hacker-news"
  }
]
Response404

Returned if the id is not found.

Response (404)
{
  "message":"Document not found"
}