
Get Article
Get an article from the Penguin Classics collection
Returns a specific article from the Penguin Classics database, based on the unique id of the article passed in on the URL. The returned article contains a reference to the book to which the article belongs.
The content of the article is presented in the content property, and will default to a JSON representation of HTML. The default JSON representation formats HTML tags as:
'tag_name': [ array of child tag objects ]
This allows tags to be nested within other tags (see example below). The text of any tag is returned as a property with a name text. Note that as tags are returned as arrays, there may be multiple text properties to any single tag.
If you require the content of the article in either HTML or text-only format, use the content-fmt parameter in the URL as described below, which will then return either JSON, HTML or text in the content property of the article. If not specified, the default is to return JSON format.
| Value | Description |
|---|---|
| html | Return HTML 5 data in the content property of the article (?content-fmt=html) |
| text | Return a text-only in the content property of the article (?content-fmt=text) |
| json | Return a json representation of the content in the content property of the article (?content-fmt=json) |
Example of viewing an article
curl https://api.pearson.com/penguin/classics/v1/articles/bNASkhAkx2T42Z?apikey=my_api_key
{
"status": 200,
"dataset": "black_classics_sb",
"url": "https://api.pearson.com/penguin/classics/v1/articles/bNASkhAkx2T42Z?apikey=my_api_key",
"article": {
"title": "VOLUME ONE: TO ——",
"id": "bNASkhAkx2T42Z",
"book": {
"title": "Evelina",
"id": "bNAS1K50wzzAqX",
"url": "https://api.pearson.com/penguin/classics/v1/books/bNAS1K50wzzAqX?apikey=my_api_key"
},
"content": [
{
"h2": [
{
"text": "TO ——"
}
]
},
{
"blockquote": [
{
"text": "\n"
},
{
"p": [
{
"text": "Oh author of my being! – far more dear"
}
]
},
...
]
}
]
}
}