SEARCH

// developer.daylife.com


Frequently Asked Questions About the Daylife API

What is the Daylife Platform all about?

Daylife helps publishers tell a better story. Our platform helps them source, manage, analyze, and compose content in new ways. What could you do if you had access to the world's news, and had a standardized and rational way to get quick responses to rich queries about what’s happening in the world? We wanted to find out so we built this massive backend that analyzes a slew of news content from a variety of sources (including those of a client’s), and exposes it via the Daylife API. (We also have a slew of WYSWIG tools to make the power of the platform accessible to non-developers, but those too are built on the same Daylife API).

We’ve created an enabling technology, and are now letting it loose into the world, so that publishers and content creators and bloggers and developers and everyone can try their hand at developing new experiences around the news, and at extending the experiences of their customers by leveraging news-based content.

So, what can I do with the Daylife API?

With it you can enhance your website (or iPhone or Android or iPad app) with relevant content from around the world.

The Daylife API provides you access to the horsepower in the Daylife platform and lets you:

  • Enhance your news content and put it in context by adding related links and headlines – on any topic – to support your content
  • Conduct and display new kinds of analyses on news subjects
  • Generate new content about content – provide headlines, links, quotes, photos, or timelines
  • Produce bold new visual expressions about the world using existing news data
  • Recirculate content from affiliate publications, and find related content from around the web
  • Create fluid, engaging news experiences, such as indexes showing what topics are rising or falling in the media’s consciousness

Does using the Daylife API require some special skills? How do I deploy the Daylife API?

Deploying the Daylife API requires the same sort of skills that it takes to write a simple interactive application on the web. PHP, RUBY, Java, Cold Fusion, Perl, or .NET level scripting skills are all it takes. It’s a bit heavier than straight HTML, but not crazy complicated.

If you need help, you can ask us. We’ll point you to someone who can work with you to deploy your Daylife API-based solution.

If you’re a commercial client, our direct assistance will be part of the package.

I’m no programmer, though. Do you offer any Plug and Play components?

Yes, we offer a whole slew of WSYWIG tools for our commercial clients. Please visit corp.daylife.com.

Can you do thing X? Can you add Feature Y?

Yes! And if not, let us know what you’d like to do... we’ll either point you in the right direction, or we’ll build it into the platform. The Daylife API has grown extensively over the past few years, all the result of client feedback.

Does Daylife index everything on the web?

No. Daylife indexes thousands of quality news oriented publications. Mainstream news sites, authoritative blogs, as well as content from partners like Getty Images, Reuters, and the AP. As a general rule of thumb, our index grows as clients ask us to add certain kinds of material, so if you’d like to see something in there, ask!

I want to get my site indexed by Daylife, what should I do?

Ask!

I don’t want to have my site indexed by Daylife.

Ask!

How can you give away your stuff for free? What’s the difference between the free Developer Daylife API and your commercially available Daylife API?

You’re sweet for caring about us!

We get paid to make the Daylife API available, at large-scale, under commercial terms. The commercial Daylife API runs on more highly available infrastructure, and is directly and synchronously supported by the Daylife Team. If you're interested in investigating a commercial Daylife API License, contact us.

We do make the Developer Daylife API available free of charge, subject to our Terms of Use and with generous but capped limitations on usage. Users of the free Developer Edition of the Daylife API must also adhere to Daylife's Branding Requirements.

Also, you'll need to rely on the community and on asynchronous (e-mail and forum) support for the Developer Daylife API.

Can I control which sources I query? Or eliminate certain sources from the results I receive?

Yes! Also, and yes!

Does the Daylife Platform support Spanish? Arabic? Mandarin?

No, the Daylife API works in English for the time being.

Does the Daylife API provide images? How does that work license-wise?

That’s a darned good question.

We can and do reference images via Daylife API calls.

You are allowed to display images for any of the professional imagery providers that you have agreements with.

There are several high-quality sources for which Daylife can grant limited licensed use, provided that you agree to certain restrictions on use and meet certain minimal requirements. Ask us about this if you want to make images part of your application.

Can I redistribute content I get from the Daylife API?

As a user of the free Developer Daylife API, you may not redistribute Daylife enabled content directly. You may serve it from your site, but you can’t proxy the Daylife API or otherwise re-serve Daylife-provided data. See our terms of use for details.

Users of the commercial Daylife API have broader rights to redistribute Daylife provided data.

Does the Daylife API automatically create pages?

You can create hundreds of thousands of unique, dynamic pages using the Daylife API. But the Daylife API provides data. It's up to you to turn that data into web content for your site or application.

How can I get articles related to a given article indexed by Daylife?

We have an API call article_getRelatedArticles that returns articles from the same story cluster that your article belongs to. However, a lot of times your article might not get clustered with a big story or you want related articles from the past.

In that case, you can use a combination of API calls to get these related articles. Here is how:

  1. You first call article_getTopics to get the list of topics mentioned in your articles with sort=relevance and the primary input is the article URL. The trick here is that the article URLs you use to query should be exactly the same as you publish in your RSS feeds, because those are the URLs we have in our databases to match against.
  2. You take the 2 most relevant topics returned and then call our search_getRelatedArticles API with query="Topic A" AND "Topic B"

If you want to restrict the results only to your publications, you can use the parameters source_whitelist=sourceidA&source_whitelist=sourceidB&source_whitelist=sourceidC and so on.

You should also use start_time that is 60-80 days in past. The default time period is one month in our APIs.

A great implementation of this is done by our client New York Post. Here is an example of an article from their site-  http://www.nypost.com/seven/01222009/news/politics/obama_a_man_of_action_on_day_1_151332.htm . The box with 2 columns between the headline and the article body on the top of the page is powered by Daylife. It shows you related stories from NYPost and all the topics mentioned in the article. If you click on the topic, you go to a Daylife powered topic page.

What are the valid topic types supported by the Daylife API

Daylife categorizes the topics into following categories:

  •  PERSON
  •  ORGANIZATION
  •  HOLIDAY
  •  DRUG
  •  DISEASE
  •  STATION
  •  PRODUCT
  •  EVENT
  •  ISSUE
  •  PLACE

You can filter the topics returned for all xxx_getRelatedTopics calls by providing these values for the include_topic_type parameter as multiple name-value pairs. E.g.:

include_topic_type=PERSON&include_topic_type=ORGANIZATION

How can I decide programmatically if I should use a Topic API call or a Search API call for a given query?

You can use topic_getInfo to determine if the query you have is a topic in Daylife or not. If it is, you will get back information about the topic such as the topic_id. If your query is not a topic in Daylife, the API will return you  an error code of -2008.

Topics are an ever-growing inventory in Daylife. There are currently the following types of topics returned by Daylife API calls:

  •  PERSON
  •  ORGANIZATION
  •  HOLIDAY
  •  DRUG
  •  DISEASE
  •  STATION
  •  PRODUCT
  •  EVENT
  •  ISSUE
  •  PLACE

In case you have a query and you want to know if there are daylife topics matching your query, you can use search_getMatchingTopics. This API returns you all the daylife topics which have a name containing all the words in your query.

Why don't topic calls work for a topic I KNOW Daylife Tracks?

Make sure you use a cannonical identifier for the topic. Try “Hillary Rodham Clinton”, or better yet, use topic_id “01EA6Cj8Fp6H7”.

The safest method for obtaining a topic is to do a search, e.g. search_getMatchingTopics(‘hillary clinton’), and it will return some topics, one of which will be “Hillary Rodham Clinton”, then pull the topic_id and use that in the topic_* calls.

When using the topic name, the topic_* calls are fairly strict – it has to be an exact match to the official topic name. if you use the topic_id instead of the name, then you also won’t have to worry if she changes her name back to “Hillary Rodham” – the topic_id will still be valid.

Where can I find a list of sources tracked by Daylife?

A list of sources can be downloaded here (last updated March 24, 2010).

What is the difference between a story and an article?

An article is the atomic piece of content that gets published by a source. It has a headline, a publish date, an excerpt and an associated source that published it.

A story is a collection of related articles. The Daylife platform clusters articles about the same news event (in a 24 hour window) into a story to help the user easily navigate the news by looking at a smaller set of data i.e. the stories. On further interest about a particular story, a user can then dive into the articles that are contained in the story.

Every story has a representative article. The Daylife platform chooses this article in a cluster based on a range of factors to ensure that it is the best representative article for that news event.

You can get stories about a topic using the API topic_getRelatedStories. You can also get a stream of articles about a topic using the API topic_getRelatedArticles, however, you would then see more articles about the same news event in this case.

What's the difference between search_getMatchingTopics and search_getRelatedTopics

search_getMatchingTopics returns you topics (people, place or organization) whose name matches with the query term provided in the request. For e.g. if the request has "query=bush", the response will contain topics such as George W. Bush, Laura Bush or Jenna Bush. An empty list is returned if the provided query does not match the name of any topic, for example - "query=iraq war"

search_getRelatedTopics returns you topics that are mentioned in articles that contain the given query term. For e.g. - "query=bush" will return you topics that were mentioned in articles that mentioned "bush". Similarly, request with "query=iraq war" returns you topics that were mentioned in the articles that mentioned "iraq war"

How can I get results restricted to a list of sources, or excluding a set of sources I don't want?

Daylife tracks news from thousands of sources across the world. Sources include mainstream news such as the New York Times, blogs such as BuzzMachine, and other types of news content sources such as Getty Images for photos.

For your application, however, you may wish to restrict the results you retrieve to suppress certain sources, or to only feature content from specific sources.

Daylife API users can restrict the results of API calls to sources of their choice by creating and accessing source filters – i.e., whitelists or blacklists of news and image sources. When a source_filter_id (see below) is passed as a parameter to a Daylife API call, then the content returned is limited by those sources enumerated in the source filter's whitelist or blacklist.

Every source filter is identified by a source_filter_id. You can have as many source filters as you like, which you can use for various purposes. For example:

  • To limit blog content in your results
  • To retrieve content only from your publication
  • To filter out content offered by publications you despise

In the current version of the Daylife API, source filters are created and maintained by Daylife. Contact us at developer@daylife.com if you'd like us to set up source filters for you.

How can I unserialize a php serialized response from the Daylife API?

You can decode php serialized response (of course in PHP) by using the unserialize function. You can read more about it here: http://php.net/unserialize.

How can I unserialize a json request from the Daylife API

Below is a list of functions/links that you can use in different languages to unserialize json serialized data: