API Documentation

API Details

 

Pan Macmillan provides an API for developers. Our API should make it easy for you to retrieve jacket images and book extracts for your own apps, websites and digital projects.

The API outputs JSON data, and shows:

  • • A HTML formatted extract from the book (plus the amount of time needed to read the extract)
  • • Author Name
  • • Book Title
  • • Jacket Image
  • • eBook ISBN
  • • Publication Date

API Endpoint: http://extracts.panmacmillan.com/getextracts

The API Endpoint can be queried using the following URL parameters in a GET Request:

  • • titlecontains
  • • authorcontains
  • • isbn
  • • publicationdategreaterthan
  • • publicationdatelessthan
  • • readingtimegreaterthan
  • • readingtimelessthan

Example Queries:
http://extracts.panmacmillan.com/getextracts?titlecontains=sword&readingtimelessthan=10
All books with 'Sword' in the title that have an extract that takes less than 10 minutes to read.

http://extracts.panmacmillan.com/getextracts?authorcontains=Jeffrey%20Archer
All books by Jeffrey Archer.

http://extracts.panmacmillan.com/getextracts?publicationdategreaterthan=2016-03-01T00:00:00Z&publicationdatelessthan=2016-03-14T00:00:00Z
All books publishing between 1st March 2016 and 14th March 2016.

At present there is no need to authenticate with our API.


Wordpress Plugin


Bloggers can also use the Pan Macmillan Book Extracts Wordpress Plugin to add extracts and lists of books by authors to your blog posts. The plugin uses shortcodes, and can also be found in the Wordpress plugin repository by searching for 'Pan Macmillan'.

Example Wordpress Plugin Usage
 

Plain Text Extract

[extract title="Mightier Than The Sword" author="Jeffrey Archer"]

Extract In Reader Pane

[extract title="Mightier Than The Sword" author="Jeffrey Archer" viewer = true]

Jacket Image With Lightbox Extract

[extract title="Mightier Than The Sword" author="Jeffrey Archer" lightbox=true images=true]

Text Link with Lightbox Extract

[extract title="Mightier Than The Sword" author="Jeffrey Archer" lightbox=true linktext="Click here to read an extract"]

List of Books By Author With External Link To Read Extract

[extract author="Jeffrey Archer"]

List of Books By Author With Lightbox To Read Extract

[extract author="Jeffrey Archer" lightbox = true]

List of Books by Author With Jackets and Link To Read Extract

[extract author="Jeffrey Archer" images=true]

List of Books By Author With Jackets and Lightbox To Read Extract

[extract author="Jeffrey Archer" images=true lightbox=true]