Feed API V2 Documentation

Feed API V2

Params

format: 
    type: string
    value: json or atom
    default: atom
pagesize:
    type: integer
    default: 200
offset:
    type: integer
    default: 0

Sample API request(JSON)

curl http://api.newscred.com/v2/feed/0569f69ed223720c699936eddbcXXXXX?format=json

 

Sample output(JSON)

{
  "title": "TechFeed",
  "modified_at": "2015-12-28T05:28:17Z",
  "entries": [{
    "content": {
      "description": "Sample description",
      "title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.",
      "created_at": "2013-11-21T11:49:21Z",
      "modified_at": "2013-11-21T12:50:44Z",
      "source": {
        "name": "T3"
      },
      "published_at": "2014-11-21T11:49:21Z",
"link": null
"customer_canonical_link": null "custom_fields": [], "authors": [{ "name": "Thomas Tamblyn" }], "images": [{ "description": null, "width": "624", "url": "http://images3.newscred.com/XXXXXXX", "height": "351", "caption": "Samsung Galaxy S5 Concept shown in video", "attribution_text": null, "source": {"name": "Test source"}, "thumbnail": "http://images3.newscred.com/XXXXXXX" }], "lang_code": "en", "guid": "XXXXXXXXXXXXXXX", "topics": [{ "guid": "XXXXXXXXXXXXXXX", "name": "iPhone 5s" }, { "guid": "XXXXXXXXXXXXXXX", "name": "Samsung" }] } }, { "content": { "description": "Another sample description", "title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.", "created_at": "2013-11-21T08:27:23Z", "modified_at": "2013-11-21T15:44:12Z", "source": { "name": "Reuters" }, "published_at": "2013-11-21T08:27:23Z", "custom_fields": [ { "values": ["Why Choose Veggie Protein", "Health"], "label": "Categories" }, { "values": [], "label": "Logo" } ], "authors": null, "images": [{ "description": "A sample", "width": "2374", "url": "http://images1.newscred.com/XXXXXXX", "height": "1413", "caption": "A customer speaks on his mobile phone as he comes out of a Nokia showroom in New Delhi", "attribution_text": "Mansi Thapliyal / Reuters/Reuters", "source": {"name": "Test source"}, "thumbnail": "http://images1.newscred.com/XXXXXXX" }], "lang_code": "en", "guid": "XXXXXXXXXXXXXXX", "topics": [{ "guid": "XXXXXXXXXXXXXXX", "name": "Pregabalin" }] } }, { "content": { "description": "Sample description", "title": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.", "created_at": "2013-11-21T13:03:46Z", "modified_at": "2013-11-21T13:03:46Z", "source": { "name": "The Los Angeles Times" }, "published_at": null, "custom_fields": [], "authors": null, "images": [{ "description": null, "width": "2400", "url": "http://images3.newscred.com/Zz04OTZiZmQzZmRmNTdhNzBjNTg3YTk5ODc4YzI2OTY2Me==", "height": "1600", "caption": null, "attribution_text": null, "source": null, "thumbnail": "http://images3.newscred.com/Zz04OTZiZmQzZmRmNTdhNzBjNTg3YTk5ODc4YzI2OTY2De==?width=75&height=75" }], "lang_code": "en", "guid": "XXXXXXXXXXXXXXX", "topics": [{ "guid": "XXXXXXXXXXXXXXX", "name": "Immigration Reform" }, { "guid": "XXXXXXXXXXXXXXX", "name": "Silicon Valley" }] } }] }

 

Sample API request(ATOM)

curl http://api.newscred.com/v2/feed/0569f69ed223720c699936eddbcXXXXX?format=atom

 

Sample output(ATOM)

<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns:media="http://search.yahoo.com/mrss/" xmlns:nc="http://api.newscred.com/v2/" xmlns="http://www.w3.org/2005/Atom">
  <id>http://api.newscred.com/feed/XXXXXXXXXXXXXXX</id>
  <title>TechFeed</title>
  <updated>2015-12-28T05:28:17+00:00</updated>
  <author>
    <name>Newscred</name>
  </author>
  <link href="http://api.newscred.com/v2/feed/XXXXXXXXXXXXXXX?format=atom&amp;pagesize=3" rel="self"/>
  <generator uri="api.newscred.com" version="v2">The Platform</generator>
  <entry>
    <id>http://api.newscred.com/content/7cb3d9710c44b47ebcb6bd324289b48b</id>
    <title>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.</title>
    <updated>2013-11-21T12:50:44+00:00</updated>
    <author>
      <name>Thomas Tamblyn</name>
    </author>
    <nc:source>
      <nc:name>VentureBeat</nc:name>
    </nc:source>
    <content type="html"><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.]]></content>
    <category term="XXXXXXXXXXXXXXX" label="iPhone 5s"/>
    <category term="XXXXXXXXXXXXXXX" label="Samsung"/>
    <media:content height="351" url="http://images3.newscred.com/XXXX" width="624">
      <media:title type="plain">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.</media:title>
      <media:description type="plain">Lorem description</media:description>
      <media:text type="plain">Lorem attribution text</media:text>
      <media:credit>Test source</media:credit>
    </media:content>
    <media:thumbnail height="351" url="http://images3.newscred.com/XXXX" width="624"/>
    <link href="http://bit.ly/Whn123" rel="alternate"/>
    <nc:customFields>
      <nc:field label="Categories">Why Choose Veggie Protein</nc:field>
      <nc:field label="Categories">Health</nc:field>
      <nc:field label="Logo"></nc:field>
    </nc:customFields>
  </entry>
  <entry>
    <id>http://api.newscred.com/content/XXXXXXXXXXXXXXX</id>
    <title>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.</title>
    <updated>2013-11-21T15:44:12+00:00</updated>
    <nc:source>
      <nc:name>VentureBeat</nc:name>
    </nc:source>
    <content type="html"><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.]]></content>
    <category term="XXXXXXXXXXXXXXX" label="Pregabalin"/>
    <category term="XXXXXXXXXXXXXXX" label="New Delhi"/>
    <media:content height="1413" url="http://images1.newscred.com/XXXXXXXXXXXXXXX==" width="2374">
      <media:title type="plain">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.</media:title>
      <media:description type="plain">Lorem description</media:description>
      <media:text type="plain"/>
      <media:credit>Test source</media:credit>
    </media:content>
    <media:thumbnail height="1413" url="http://images1.newscred.com/XXXXXXXXXXXXXXX" width="2374"/>
  </entry>
  <entry>
    <id>http://api.newscred.com/content/XXXXXXXXXXXXXXX</id>
    <title>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.</title>
    <updated>2013-11-21T13:03:46+00:00</updated>
    <content type="html"><![CDATA[Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer dignissim.]]></content>
    <nc:source>
      <nc:name>VentureBeat</nc:name>
    </nc:source>
    <category term="XXXXXXXXXXXXXXX" label="Immigration Reform"/>
    <category term="XXXXXXXXXXXXXXX" label="Silicon Valley"/>
    <media:content height="1600" url="http://images3.newscred.com/XXXXXXX" width="2400">
      <media:title type="plain"/>
      <media:description type="plain">Lorem description</media:description>
      <media:text type="plain">Lorem attribution text</media:text>
      <media:credit/>
    </media:content>
    <media:thumbnail height="1600" url="http://images3.newscred.com/XXXXXXXXXXXXXXX" width="2400"/>
  </entry>
</feed>

Error message

Invalid feed guid

With feed guid that does not exists the server will respond with HTTP status code 404.

curl https://api.newscred.com/v2/feed/0569f69ed223720c699936eddbc5b123?format=json
HTTP/1.1 404 NOT FOUND
Content-Length: 121
X-Request-ID:c384254ec33011e58a070242ac110002

{
  "error": {
    "code": "404",
    "message": "Collection with guid 0569f69ed223720c699936eddbc5b123 not found"
  }
}

Upgrading to V2 feed

V2 feed endpoint is a smaller and readable version with a shorter URL without any access key. Each properties of V2 can be mapped to fields of old collection endpoint. The mapping looks like the following. Here the left key is for the new V2 API and the right values mapped from old collection API.

All the date now follows the rfc3339 format.

  

Old feed Feed V2 New field
  title Y
modified_at modified_at N
collection_item_set entries N
collection_item_set->content entries->content N
collection_item_set->content->guid entries->content->guid N
collection_item_set->content->image_set entries->content->images N
collection_item_set->content->image_set->caption entries->content->images->caption N
collection_item_set->content->image_set->attribution_text entries->content->images->attribution_text N
collection_item_set->content->image_set->source entries->content->images->attribution_text N
collection_item_set->content->image_set->description entries->content->images->description N
collection_item_set->content->image_set->height entries->content->images->height N
collection_item_set->content->image_set->width entries->content->images->width N
collection_item_set->content->image_set->urls->small entries->content->images->thumbnail N
collection_item_set->content->image_set->urls->large entries->content->images->url N
collection_item_set->content->author_set entries->content->authors N
collection_item_set->content->topic_set entries->content->categories N
collection_item_set->content->title entries->content->title N
collection_item_set->content->description entries->content->description N
collection_item_set->content->created_at entries->content->created_at N
collection_item_set->content->modified_at entries->content->modified_at N
collection_item_set->content->metadata->cmc_published_at entries->content->published_at N
collection_item_set->content->source entries->content->source N
collection_item_set->content->lang_code entries->content->lang_code N
collection_item_set->content->metadata->custom_fields_set entries->content->custom_fields N
Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk