News API

Open API Specification

Open API Specification (Swagger) documentation can be found here: News REST API. To test the APIs in the documentation site, click the Authorize button. Paste the test key of oViXqthDGFNVw3IvAsnKrFG1AcfPyA6b in the apikey-query text box.

News, Blogs and Columns

The DTN Publishing (News) API can be used to get News, Blogs and Column data that is available on the DTN Progressive Farmer web site (https://www.dtnpf.com). Depending on your subscription level, you will be able to get links to the articles on the DTN web site, or get the full article through our API.

Usage

Technical documentation exists to cover the nuts-and-bolts of accessing the Publishing API endpoints in much greater detail. See: /api/rest-api-for-news-blogs-and-columns/. But to give a you an idea of how the API can be used to build out your web site to display DTNPF news content, the following is a high level view of what is available. In the a general overview, the endpoints for the Publishing API fall into three sets of URLs:

  • …/publishing/blogs…
  • …/publishing/news…
  • …/publishing/columns…

The document presents the information you may need, in order to build your own applications to display DTN Newsroom content.

So what is this content?

Content obtained through the Publishing API (News API) falls into just two main groups, and a few sub categories. The two main groups are:

  • Blogs
  • News

Blogs

Blogs represent regular posting under known categories. Each blog in a category will cover the same general topic. For example, one of the DTN blogs is “Ethanol Blog”. The Ethanol Blog covers all things ethanol, and is published weekly, but other blogs can be published twice-a-month, or even just monthly. There are two key points to remember about blogs:

  • The content of a given blog post cannot be viewed outside DTNPF.
  • Blogs are a series of posts on a common topic.
  • Blogs generally have the same author, but special guest authors can occur.

Blog Endpoints

The expected sequence of operations that one might be expected to execute to access blogs is:

  • Access …/publishing/blogs: this will return a list of the configured set of blogs, which will include their identification numbers (blog id), their names, and some additional information.
  • Determine which blog to access for a listing of posts.
  • Access …/publishing/blogs/{blog id}/posts: this will return a list of posts for the given blog id.
  • Each listed blog post contains a URL reference to the blog content on DTNPF.

The above sequence covers, say, a web site displaying the most recent posts for a given blog: pull the list of blogs to make sure that the category it is supposed to be using still exists, then pull the list of recent blog posts for that blog id. When a user clicks on one of the blog posts…then they are linked to DTNPF to see the particular post, as well as associated comments.

Note: there is an additional convenience endpoint to retrieve the list of most recently published blog posts.

News

News items are more general than blogs; the term ‘news’ in the DTN context is composed of several different sub-categories of content, all very similar:

  • Content generated in the award winning DTN Newsroom; a subtype of this is a column.
  • Content fed from outside organizations too DTN; examples: AP Online, Dow Jones newswire, USDA

There is some differences between the types of news content: some items will have associated pictures, some won’t. Some items will have authors (a DTN author), some won’t. Some items will be very simply formatted, others will be more heavily marked up. In general, there are two types of news articles that can be accessed:

  • Content from the DTN Newsroom. This content:
    • may or may not have an author;
    • may or may not have an associated image (and a caption for that image);
    • is the story content itself.
  • Content originating outside the DTN Newsroom (example: individual USDA reports):
    • will not have an author;
    • will not have an associated image;
    • story content will be only lightly marked up: in nearly all cases, the content will be simple text wrapped in <pre>…</pre> tags;
    • may have no text content at all; instead, the content may be an image reference; in this case, the image is the story.

News Endpoints

The expected sequence of operations that are expected to be executed to access news is:

  • Access …/publishing/news/categories: this will return a list of the configured sets of news categories, which will include their identification (id), and a symbolic name. Symbolic names are meant to be somewhat descriptive of their contents.
  • Determine which news categories to display for listing headlines.
  • Access …/publishing/news/categories/{category id}/headlines: this will return a list of the most recent headlines for the indicated category id. Each headline will have a unique id.
  • Access …/publishing/news/articles/{article id}: this will return an article corresponding to the given id.

The above sequence covers say, a news HTML page displaying the most recent headlines for a given category (say, “Cotton News”): the page pulls the categories endpoint to make sure that the category it is supposed to be using still exists, then it pulls the list of recent headlines. When the user clicks on one of the headlines in the widget UI, then the article itself is shown, maybe in this case, in a pop up.

An article, or news item in DTN parlance, contains all the information provided on a headline, but also the content of the story typically with HTML markup.

Columns Endpoints

Columns are at their heart, just news articles. These are a group of news articles that appear under the same title every week, or every two weeks, or every month, always written by the same author; something like a personal byline. Imagine a column is like a blog…but there isn’t any posting of comments, and the common thread between ‘posts’ in a column can be more general than what is seen in blogs. Three such example columns are: Ask the Taxman, Washington Insider, and Letters to the Editor.

The sequence is expected to fit the following sequence:

  • Access …/publishing/columns: this will return a list of the configured sets of news columns, which will include their identification (id), and name associated with it.
  • Determine which columns to display for a listing headlines.
  • Access …/publishing/columns/{column id}/headlines: this will return a list of the most recent headlines for the indicated column id. Each headline will have a unique id.
  • Access …/publishing/column/articles/{article id}: this will return an article corresponding to the given id.

The returned data fits exactly the headline/article model presented for news endpoints.

DTN Weather Commentary

The Weather Commentary that displays on DTNPF can also be retrieved through the API to display on your web site. The weather commentary is a special news article and can be obtained by using the Publishing (News) API. In this case, you simply need to use the following article identifier: 0702CC91

Making an API request to /publishing/news/articles/0702CC91 will retrieve an article containing the latest DTN Weather Commentary. This will return an Article type.