Citation Formatting API: Debugging Tips & Analytics

Due to the JSON schema of the Citation API, it can be difficult to easily determine answers to questions like “What field do I use to find the title of a source.” Here are some tips:

Titles:

  • If the article title exists, e.g. data.source.title, use that. Otherwise, use the publication title: data[data.pubtype.main].title
  • Article titles are the name of the article, whereas a publication title is the title of the source containing the article. For example, “U.S. Trains Commandos in Fight Against Terrorism” is an article title, and the source title is New York Times.
  • Use article title when it exists and is not empty, and publication title otherwise.

Example:

  • source: newspaper
  • pubtype.main: pubnewspaper
  • Use data.newspaper.title or if this does not exist, data.pubnewspaper.title is what you should use.

Authors:

  • data.contributors

Example:

  • {“contributors” : …}

URL:

  • Use data.pubonline.url if it exists, or use data.pubdatabase.searchtext if it exists.

Example:

  • data.pubonline.url = url of source, or data.pubdatabase.searchtext = url of source

Publisher:

  • data[data.pubtype.main].publisher

Date published:

  • data[data.pubtype.main].day
  • data[data.pubtype.main].month
  • data[data.pubtype.main].year

Example:

  • For example, let’s say data.pubtype.main = pubjournal
  • data.pubjournal.day, data.pubjournal.month, and data.pubjournal.year are what you should be using.