The root object of an Apple News article, containing required properties, metadata, content, layout, and styles.
Technology
- Apple News Format 1.7+
Properties
components
component Text Styles
The component text styles that can be referred to by components in this document. Each article
file must have, at minimum, a default component text style named default
. Defaults by component role can also be set. See Defining and Applying Text Styles.
identifier
string
An unique, publisher-provided identifier for this article. This identifier must remain constant; it cannot change when the article is updated.
This identifier can include the following:
Up to 64 characters
Uppercase and lowercase letters
Numbers
Hyphens
Underscores
language
string
A code that indicates the language of the article. Use the IANA.org language subtag registry to find the appropriate code; e.g., en
for English, or the more specific en-GB
for English (U.K.) or en-US
for English (U.S.).
layout
The article’s column system. Apple News Format layouts make it possible to recreate print design on iPhone, iPad, iPod touch and Mac. Layout information is also used to calculate relative positioning and size for these devices. See Planning the Layout for Your Article.
title
string
The article title or headline. Should be plain text; formatted text (HTML or Markdown) is not supported.
version
string
The version of Apple News Format used in the JSON document.
The value of the version
property must not be earlier than the version number of any property that is used anywhere in the article.
advertising Settings
An advertisement to be inserted at a position that is both possible and optimal. You can specify what banner
you want to have automatically inserted.
Note. This property is deprecated. Use the AdvertisementAutoPlacement object instead.
autoplacement
The metadata, appearance, and placement of advertising and related content components within Apple News Format articles.
component Layouts
The article-level Component
objects that can be referred to by their key within the Component
object. See Positioning the Content in Your Article.
component Styles
The component styles that can be referred to by components within this document. See Enhancing Your Articles with Styles.
document Style
An object containing the background color of the article.
metadata
The article's metadata, such as publication date, ad campaign data, and other information that is not part of the core article content.
subtitle
string
The article subtitle. Should be plain text; formatted text (HTML or Markdown) is not supported.
text Styles
The Text
objects available to use inline for text in Text
components. See Using HTML with Apple News Format, Using Markdown with Apple News Format, and InlineTextStyle.
Discussion
Every Apple News Format document must have the same filename: article
. An article
file must contain the Article
object. This is the object that is sent in Create an Article and Update an Article requests.
Warning
Every Apple News Format document must contain all items marked as required in the preceding Properties table. Omissions will result in errors in the Apple News API and News Preview. See Create an Article and Update an Article.
In JSON, the order of properties in an object is not important; however, as you create your JSON document, you may find it useful to follow the order shown in the example that follows.
To view this example in News Preview, copy the example code to a file named article
and put a file named image
in the same folder. (You can use any JPEG, GIF, or PNG file.)
Example
{
"version": "1.7",
"identifier": "SampleArticle",
"language": "en",
"title": "Apple News App",
"subtitle": "A look at the features of the News iOS app",
"layout": {
"columns": 20,
"width": 1024,
"margin": 60,
"gutter": 20
},
"components": [
{
"role": "title",
"text": "Apple News App",
"textStyle": "title"
},
{
"role": "body",
"text": "The Apple News Format allows publishers to craft beautiful editorial layouts. Galleries, audio, video, and fun interactions like animation make stories spring to life."
},
{
"role": "photo",
"URL": "bundle://image.jpg"
}
],
"documentStyle": {
"backgroundColor": "#F7F7F7"
},
"componentTextStyles": {
"default": {
"fontName": "Helvetica",
"fontSize": 13,
"linkStyle": {
"textColor": "#428bca"
}
},
"title": {
"fontName": "Helvetica-Bold",
"fontSize": 30,
"hyphenation": false
},
"default-body": {
"fontName": "Helvetica",
"fontSize": 13
}
}
}