Introduction

The Lateral API

Tools

Article Extractor API reference

An API to parse content in article form from a URL.

API Base URL

https://document-parser-api.lateral.io/

Authentication

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

Subscription-Key: YOUR_API_KEY

Rate Limiting

Requests are limited to 1 per second. Information about the rate limiting is stored in the X-RateLimit-Limit and X-RateLimit-Remaining response headers.

Caching

If we have already fetched a URL in the past day, a cached copy of the object will be returned. If a day has passed since we last parsed the URL then it will be re-fetched. This should cover any issues that may arise if an article changes over time.

API Specification

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

Document Parser

Extract article/?url={url}

GET/?url={url}Extract article
Code Sample

Extract useful information from an article or blog post.

Parameters
Name Example Description
url(string, required) The URL to parse
Response200

Note: the keywords, description and body fields were truncated for display purposes.

Response (200)
    {
      "title": "Press me! The buttons that lie to you",
      "author": "Chris Baraniuk",
      "published": "2015-04-15T00:00:00.000Z",
      "url": "http://www.bbc.com/future/story/20150415-the-buttons-that-do-nothing",
      "image": "http://ichef.bbci.co.uk/wwfeatures/624_351/images/live/p0/2p/7f/p02p7fts.jpg",
      "videos": [],
      "keywords": ["control", "lie", "button", "system", "effect", "buttons", [...]],
      "description": "Does it help to push the buttons on pedestrian crossings, [...]",
      "body": "The tube pulls in to a busy station along the London Underground’s [...]"
    }
Response400

The possible message values are:

  • url is missing, url is empty

  • Unable to parse the URL provided (when URL is not a valid format)

  • HTTP response error (when the server of the URL responds with a bad response)

  • URL responded with a XXX status code

  • Content at URL is too large

  • Content-Type XXX is not supported

Response (400)
{
  "message": "url is missing, url is empty"
}
Response429

Returned if you are requesting too frequently

Response (429)
{
  "message": "API rate limit exceeded"
}
Response404
Response (404)
{
  "message": "API path not found"
}
Response500

Server error, oops!

Response (500)
{
  "message": "Internal Server Error"
}