Introduction

The Lateral API

Pre-populated datasets

Tools

Sign-up for an API Key

Wikipedia 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

Wikipedia

Recommend by text/documents/similar-to-text?fields=meta

POST/documents/similar-to-text?fields=metaRecommend by text
Code Sample

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

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

The recommendations, truncated

Response (200)
[
  {
      "id": "0000362a0b589c908fe01fd7bb302b6a",
      "meta": {
        "url": "http://en.wikipedia.org/wiki?curid=12566618",
        "date": "2013-10-20",
        "title": "Arc International",
        "document_id": "wikipedia-12566618"
      },
      "similarity": 1
    },
    {
      "id": "46951eff438212c9df72c303a27cff6b",
      "meta": {
        "url": "http://en.wikipedia.org/wiki?curid=3546083",
        "date": "2013-10-20",
        "title": "World Kitchen",
        "document_id": "wikipedia-3546083"
      },
      "similarity": 0.8403602838999999
    },
  ...
]

Recommend by ID/documents/{id}/similar?fields=meta

GET/documents/{id}/similar?fields=metaRecommend by ID
Code Sample

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

Response200

The recommendations, truncated

Response (200)
[
  {
    "id": "0000362a0b589c908fe01fd7bb302b6a",
    "meta": {
      "url": "http://en.wikipedia.org/wiki?curid=12566618",
      "date": "2013-10-20",
      "title": "Arc International",
      "document_id": "wikipedia-12566618"
    },
    "similarity": 1
  },
  {
    "id": "46951eff438212c9df72c303a27cff6b",
    "meta": {
      "url": "http://en.wikipedia.org/wiki?curid=3546083",
      "date": "2013-10-20",
      "title": "World Kitchen",
      "document_id": "wikipedia-3546083"
    },
    "similarity": 0.8403602838999999
  },
  ...
]
Response404

Returned if the id is not found.

Response (404)
{ "message":"Couldn't find Document" }