Sample code

Sample tools and applications illustrating API requests and authorization flow


JavaScript Readership Locations

A JavaScript example showing document reader locations plotted onto a world map. Illustrates implicit OAuth flow, fetching user documents and requesting readership statistics for catalog documents. GitHub source code repository


Python Example

A Python web application, written using Flask, which shows documents in the user's Mendeley library together with the document annotations. Catalog documents can also be retrieved using a DOI. GitHub source code repository

Python Catalog Example

A command-line Python script that retrieves the number of Mendeley users that have read a document. The script uses an OAuth client credentials flow, so users don't have to log in to use the application. GitHub source code repository

Node Example

Node Example

A simple node application that demonstrates both the Authorisation Code Flow and the Implicit Grant Flow. Can be deployed on Heroku. GitHub source code repository


Ruby Auth

This Ruby gem will provide you with a simple library to obtain tokens to use the Client Credentials Flow or the Implicit Grant Flow to access the Mendeley API GitHub source code repository

Ruby Identifier Catalog Search

A Ruby example script that populates a command-line user interface with identifier_types, and then performs a search for a catalog document using the chosen identifier type. GitHub source code repository

Ruby Catalog Search

A command-line Ruby script, taking a file argument, that searches for a Catalog document referencing the same file. Illustrates client credentials OAuth flow and requesting a catalog document using a SHA1 hash of a file. GitHub source code repository