Topic Calls



The topic API method calls return articles, quotes, images and topics for a given topic name or topic id.

Note: Topic data can be queried by either specifying a topic name as the "name" parameter or a topic id as the "topic_id" parameter. One of these must be set.

 

topic_getInfo

This function returns basic information about a given topic specified by name.

Sample Invocation

Input Parameters

Name Description Type Required Sample Values Default Value
accesskey string Y <your_access_key> N/A
signature string Y <calculated_signature> N/A
topic_id A topic id for the topic in question string Y 045WeJhgDw2Te N/A
name The topic name string Y George W. Bush N/A
include_image Flag to specify if one thumbnail image is to be returned int N 0 or 1 0
include_wikipedia_info Flag to specify if wiki abstract for the topic is to be returned int N 0 or 1 0

 

Sample Output

* Note that as of API version 4.7. the API returns a <hero_image> for a topic if available. Hero images are headshots/logos for topics, where the <hero_image> has been editorially chosen.

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<topic>
			<topic_id type="str">0dVm3LAbhJbES</topic_id>
			<type type="str">PLACE</type>
			<name type="str">United States</name>
			<daylife_url type="str">http://www.daylife.com/topic/United_States</daylife_url>
			<image>
				<url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/45x45.jpg</url>
				<daylife_url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/340x.jpg</daylife_url>
				<thumb_url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/45x45.jpg</thumb_url>
				<timestamp_epoch type="int4">1177281949</timestamp_epoch>
				<timestamp type="str">2007-04-22 22:45:49</timestamp>
				<credit type="str">AFP/Getty Images</credit>
				<image_topic_relevance type="int4">10</image_topic_relevance>
				<width type="int4">2860</width>
				<height type="int4">2268</height>
				<image_id type="str">0gwb63H2Wmapg</image_id>
				<caption type="str">
					Vania King of the US (L) speaks with US team captain Zena Garrison (R) 
					during a break in her match against Kirsten Flipken of Belgium in the 
					quarter-finals round in the Fed Cup World Group 2007 between Belgium and 
					the US in Delray Beach, Florida 22 April 2007. King won the match 4-6, 
					6-4, 7-5 to give the US a total score of 3-0 and move to the next round
				</caption>
				<source>
					<name type="str">Getty Images</name>
					<url type="str">http://gettyimages.com/</url>
					<daylife_url type="str">http://www.daylife.com/source/Getty_Images</daylife_url>
					<rank type="int4">1</rank>
					<source_id type="str">0a9L9fsaU55wK</source_id>
					<type type="int4">6</type>
				</source>
			</image>
			<hero_image>
				<image_id type="str">0cPc4PR4931gF</image_id>
				<hero_image_id type="str">06XG7hW7SE63s</hero_image_id>
				<hero_image_url type="str">http://cache.daylife.com/imageserve/06XG7hW7SE63s/60x60.jpg</hero_image_url>
			</hero_image>
			<wiki_info>
				<url type="str">http://en.wikipedia.org/wiki/Hillary_Rodham_Clinton</url>
				<abstract type="str">Hillary Rodham Clinton (born Hillary Diane Rodham on October 26, 1947) is the junior 
					United States Senator from New York. She is married to Bill Clinton, the 42nd President of the 
					United States, and was First Lady of the United States from 1993 to 2001. Before that, 
					she was a lawyer and the First Lady of Arkansas. She is a member of the Democratic Party.
				</abstract>
			</wiki_info>
		</topic>
	</payload>
</response>

back to top

topic_getRelatedArticles

This method is used to retrieve recent articles that contain the given topic specified by name or topic id.

Sample Invocation

Input Parameters

Name Description Type Required Sample Values Default Value
accesskey string Y <your_access_key> N/A
signature string Y <calculated_signature> N/A
name The topic name string Y else topic_id George W. Bush N/A
topic_id The topic id string Y else name 03cV5zI2fk03s N/A
end_time Timestamp N 2007-03 <current time>
start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
limit The number of results to be returned integer N 40 10
offset integer N 5 0
sort Flag to indicate the sorting order string N date, relevance date
source_filter_id daylife source filter id string N 06T8a8lavf8sc None
threshold minimum topic relevance score for returned item (1 to 9) integer N 1, 9 1
block_nsfw flag to indicate if content scored as obscene should be blocked integer N 1 0
source_blacklist one or more name value pairs of Daylife source ids to exclude from returned results string N source_blacklist=0a0F0VifAodow&source_blacklist=04Ew78S3C96yc None
source_whitelist one or more name value pairs of Daylife source ids, used to restrict returned results to the enumerated set string N source_whitelist=0a0F0VifAodow&source_whitelist=04Ew78S3C96yc None
include_image Flag to request the return of a related article image , if available, with the article data. integer N 0 or 1 0
has_image Flag to request that ONLY articles with associated images be returned. integer N 0 or 1 0
include_scores Flag to indicate if enhanced score data be included for every article if available. integer N 0 or 1 0
sliding_excerpt Flag to suppress sliding excerpts. integer N 0 or 1 1

 

Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<article>
			<timestamp_epoch type="int4">1200682287</timestamp_epoch>
			<source>
				<name type="str">Associated Press</name>
				<url type="str">http://hosted.ap.org/</url>
				<daylife_url type="str">http://www.daylife.com/source/Associated_Press</daylife_url>
				<rank type="int4">1</rank>
				<source_id type="str">0f279rG8jo3Is</source_id>
				<type type="int4">1</type>
				<favicon_url type="str">http://favicon.daylife.com/imageserve/0g0BarQeCPe2i/favicon.png</favicon_url>
			</source>
			<headline type="str">Sunni Sheik Offers Guns and Gets Rewards</headline>
			<timestamp type="str">2008-01-18 18:51:27</timestamp>
			<related_article_count type="int4">13</related_article_count>
			<excerpt type="str">They know him as the sheik. But what that really means in this Sunni town 
				is a bit of everything: community leader, public works supervisor, agricultural planner, 
				militia captain.
			</excerpt>
			<url type="str">http://hosted.ap.org/dynamic/stories/I/IRAQ_SHEIKS_BARGAIN?SITE=TNKNN</url>
			<daylife_url type="str">http://www.daylife.com/article/03j9fqr8kkb6B</daylife_url>
			<article_id type="str">03j9fqr8kkb6B</article_id>
			<scores>
				<newsdomain type="str">World</newsdomain>
				<op-ed type="int4">5</op-ed>
				<spinometer type="int4">-5</spinometer>
			</scores>
		</article>
		........
		........
	</payload>
</response>




back to top

topic_getRelatedTopics

This method retrieves topics that appear in the same articles as the given topic specified by name or topic id.

Sample Invocation

Input Parameters

Name Description Type Required Sample Values Default Value
accesskey string Y <your_access_key> N/A
signature string Y <calculated_signature> N/A
name The topic name string Y else topic_id George W. Bush N/A
topic_id The topic id string Y else name 03cV5zI2fk03s N/A
end_time Timestamp N 2007-03 <current time>
start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
limit The number of results to be returned integer N 40 10
offset integer N 5 0
sort Flag to indicate the sorting order string N date, relevance date
source_filter_id daylife source filter id string N 06T8a8lavf8sc None
source_whitelist one or more name value pairs of Daylife source ids string N source_whitelist=0a0F0VifAodow&source_whitelist=04Ew78S3C96yc None
threshold minimum topic relevance score for returned item (1 to 9) integer N 1, 9 1
source_blacklist one or more name value pairs of Daylife source ids to exclude from returned results string N source_blacklist=0a0F0VifAodow&source_blacklist=04Ew78S3C96yc None
include_topic_type One or more name value pairs indicating which sorts of topics you wish to include string N PERSON, ORGANIZATION, PLACE, EVENT, HOLIDAY, ISSUE, SPORT, STATION, PRODUCT, DRUG, DISEASE All types of topics
include_image Flag that indicates if a thumbnail image for each topic should be returned if available. integer N 0 or 1 0
include_wikipedia_info Flag to specify if wiki abstract for the topic is to be returned int N 0 or 1 0

 Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<topic>
			<topic_id type="str">0dVm3LAbhJbES</topic_id>
			<type type="str">PLACE</type>
			<name type="str">United States</name>
			<daylife_url type="str">http://www.daylife.com/topic/United_States</daylife_url>
			<image>
				<url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/45x45.jpg</url>
				<daylife_url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/340x.jpg</daylife_url>
				<thumb_url type="str">http://cache.daylife.com/imageserve/0gwb63H2Wmapg/45x45.jpg</thumb_url>
				<timestamp_epoch type="int4">1177281949</timestamp_epoch>
				<timestamp type="str">2007-04-22 22:45:49</timestamp>
				<credit type="str">AFP/Getty Images</credit>
				<image_topic_relevance type="int4">10</image_topic_relevance>
				<width type="int4">2860</width>
				<height type="int4">2268</height>
				<image_id type="str">0gwb63H2Wmapg</image_id>
				<caption type="str">
					Vania King of the US (L) speaks with US team captain Zena Garrison (R) 
					during a break in her match against Kirsten Flipken of Belgium in the 
					quarter-finals round in the Fed Cup World Group 2007 between Belgium and 
					the US in Delray Beach, Florida 22 April 2007. King won the match 4-6, 
					6-4, 7-5 to give the US a total score of 3-0 and move to the next round
				</caption>
				<source>
					<name type="str">Getty Images</name>
					<url type="str">http://gettyimages.com/</url>
					<daylife_url type="str">http://www.daylife.com/source/Getty_Images</daylife_url>
					<rank type="int4">1</rank>
					<source_id type="str">0a9L9fsaU55wK</source_id>
					<type type="int4">6</type>
				</source>
			</image>
		</topic>
		........
		........
	</payload>
</response>

back to top

topic_getRelatedImages

Note: In order to retrieve images from the Daylife API, you must have a commercial agreement with Daylife, and the appropriate licensing arrangement with the image provider (for example, Getty Images, Reuters, the Associated Press, Demotix...) Contact us if you'd like to learn more about this.

This method is used to retrieve images related to the given topic. 

Sample Invocation

Input Parameters

Name Description Type Required Sample Values Default Value
accesskey string Y <your_access_key> N/A
signature string Y <calculated_signature> N/A
name The topic name string Y else topic_id George W. Bush N/A
topic_id The topic id string Y else name 03cV5zI2fk03s N/A
end_time Timestamp N 2007-03 <current time>
start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
limit The number of results to be returned integer N 40 10
offset integer N 5 0
sort Flag to indicate the sorting order string N date, relevance date
source_filter_id daylife source filter id string N 06T8a8lavf8sc None
min_topic_image_confidence parameter to threshold the on the relevance of the topic to image relevance
string N low, medium, high
None

 Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<image>
			<url type="str">http://cache.daylife.com/imageserve/0dDR845cPSa7m/610x.jpg</url>
			<daylife_url type="str">http://cache.daylife.com/imageserve/0dDR845cPSa7m/340x.jpg</daylife_url>
			<thumb_url type="str">http://cache.daylife.com/imageserve/0dDR845cPSa7m/45x45.jpg</thumb_url>
			<timestamp_epoch type="int4">1200582120</timestamp_epoch>
			<timestamp type="str">2008-01-17 15:02:00</timestamp>
			<image_id type="str">0dDR845cPSa7m</image_id>
			<image_topic_relevance type="int4">10</image_topic_relevance>
			<width type="int4">3000</width>
			<height type="int4">1915</height>
			<caption type="str">
				US President George W. Bush (C) meets with the Special Envoy for Sudan, 
				Richard Williamson (L) and Secretary of State Condoleezza Rice (R), in the Oval 
				Office at the White House in Washington, DC, 17 January 2008.
			</caption>
			<credit type="str">AFP/Getty Images</credit>
			<source>
				<name type="str">Getty Images</name>
				<url type="str">http://gettyimages.com/</url>
				<daylife_url type="str">http://www.daylife.com/source/Getty_Images</daylife_url>
				<rank type="int4">1</rank>
				<source_id type="str">0a9L9fsaU55wK</source_id>
                                <favicon_url type="str">http://favicon.daylife.com/imageserve/06T8a8lavf8sc/favicon.png</favicon_url>
				<type type="int4">6</type>
			</source>
		</image>
		....
		....
	</payload>
</response>

back to top

topic_getRelatedVideos

 

This method is used to retrieve videos related to the given topic. Note that most of the videos that Daylife indexes are rights restricted, and thus returned only to API users who have appropriate usage rights.

Sample Invocation

Input Parameters

Name Description Type Required Sample Values Default Value
accesskey string Y <your_access_key> N/A
signature string Y <calculated_signature> N/A
name The topic name string Y else topic_id George W. Bush N/A
topic_id The topic id string Y else name 03cV5zI2fk03s N/A
end_time Timestamp N 2007-03 <current time>
start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
limit The number of results to be returned integer N 40 10
offset integer N 5 0
sort Flag to indicate the sorting order string N date, relevance date
source_filter_id daylife source filter id string N 06T8a8lavf8sc None
min_topic_video_confidence parameter to threshold returned results on the relevance of the topic to video relevance
string N low, medium, high
None
source_whitelist one or more name value pairs of Daylife source ids string N source_whitelist=0a0F0VifAodow&source_whitelist=04Ew78S3C96yc None
source_blacklist one or more name value pairs of Daylife source ids to exclude from returned results string N source_blacklist=0a0F0VifAodow&source_blacklist=04Ew78S3C96yc None

 Sample Output:

<response>
<message type="str">Success</message>
<code type="int4">2001</code>
<payload>
<video>
<credit type="str"/>
<video_id type="str">02Rdeh50Xd8Ac</video_id>
<timestamp_epoch type="int4">1285090620</timestamp_epoch>
<headline type="str">
McAuliffe: People Want To Vent To President
</headline>
<timestamp type="str">2010-09-21 17:37:00</timestamp>
<content_url type="str">
http://images.rcp.realclearpolitics.com/47135_1_.jpg
</content_url>

<caption type="str">
MSNBC: Mika Brzezinski, Joe Scarborough, and
Terry McAuliffe discuss President Obama's
performance during the CNBC townhall,
and how his direct conversation with
Americans is ultimately a good thing.
</caption>

<source>
<name type="str">Real Clear Politics</name>
<url type="str">http://www.realclearpolitics.com/blog/</url>
<daylife_url type="str">http://www.daylife.com/source/Real_Clear_Politics</daylife_url>
<rank type="int4">3</rank>
<favicon_url type="str">
http://favicon.daylife.com/imageserve/0gqScxf7BT8E1/favicon.png
</favicon_url>
<source_id type="str">0gqScxf7BT8E1</source_id>
<type type="str">MAINSTREAM</type>
</source>
<content_type type="str">image/jpeg</content_type>

<thumb_url type="str">
http://cache.daylife.com/imageserve/02Rdeh50Xd8Ac/120x90.jpg
</thumb_url>
<media_topic_relevance type="int4">0</media_topic_relevance>

<page_url type="str">
http://www.realclearpolitics.com/video/2010/09/21/mcauliffe_people_want_...
</page_url>
</video>
</payload>
</response>

back to top

topic_getRelatedQuotes

This method is used to retrieve quotes from articles that contain the given topic specified by name or topic id.

Sample Invocation

Input Parameters

    Name Description Type Required Sample Values Default Value
    accesskey string Y <your_access_key> N/A
    signature string Y <calculated_signature> N/A
    name The topic name string Y else topic_id George W. Bush N/A
    topic_id The topic id string Y else name 03cV5zI2fk03s N/A
    end_time Timestamp N 2007-03 <current time>
    start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
    limit the number of results to be returned integer N 40 10
    offset integer N 5 0
    sort flag to indicate the sorting order string N date, relevance date
    source_filter_id daylife source filter id string N 06T8a8lavf8sc None
    source_whitelist one or more name value pairs of Daylife source ids string N source_whitelist=0a0F0VifAodow&source_whitelist=04Ew78S3C96yc None
    require_speaker flag specifying the quotes returned must be attributed integer N 0 or 1 0
    speaker_topic_id topic_ids of topics that the quotes returned must be attributed to string N list of topic_ids for topics specified as speaker_topic_id=topicIDA&speaker_topic_id=topicIDB and so on None
    threshold minimum topic relevance score for returned item (1 to 9) integer N 1, 9 1
    block_nsfw flag to indicate if content scored as obscene should be blocked integer N 1 0
    source_blacklist one or more name value pairs of Daylife source ids to exclude from returned results string N source_blacklist=0a0F0VifAodow&source_blacklist=04Ew78S3C96yc None

Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<quote>
			<quote_id type="str">03TWezQa1M85p</quote_id>
			<timestamp_epoch type="int4">1200749352</timestamp_epoch>
			<timestamp type="str">2008-01-19 13:29:12</timestamp>
			<quote_text type="str">But we will still be friends with the 
						Americans and invite them to tea every 
						time they drive through the town
			</quote_text>
			<topic>
				<daylife_url type="str">http://www.daylife.com/topic/Condoleezza_Rice</daylife_url>
				<type type="str">PERSON</type>
				<name type="str">Condoleezza Rice</name>
				<topic_id type="str">01PQ0QsaGm49k</topic_id>
			</topic>
			<source>
				<name type="str">MSNBC</name>
				<url type="str">http://www.msnbc.msn.com/</url>
				<daylife_url type="str">http://www.daylife.com/source/MSNBC</daylife_url>
				<rank type="int4">1</rank>
				<source_id type="str">07yTb3kbhD6Bo</source_id>
				<type type="int4">1</type>
			</source>
			<daylife_url type="str">http://www.daylife.com/quote/03TWezQa1M85p</daylife_url>
			<article>
				<timestamp_epoch type="int4">1200749352</timestamp_epoch>
				<headline type="str">'Awakening' pacts prove complicated</headline>
				<timestamp type="str">2008-01-19 13:29:12</timestamp>
				<url type="str">http://www.msnbc.msn.com/id/22739412/</url>
				<daylife_url type="str">http://www.daylife.com/article/0baOdqcflg2hB</daylife_url>
				<article_id type="str">0baOdqcflg2hB</article_id>
			</article>
		</quote>
		........
		........
	</payload>
</response>

back to top

topic_getQuotesBy

This method is used to retrieve quotes said by the topic specified using the name or the topic id.

Sample Invocation

Input Parameters

    Name Description Type Required Sample Values Default Value
    accesskey string Y <your_access_key> N/A
    signature string Y <calculated_signature> N/A
    name The topic name string Y else topic_id George W. Bush N/A
    topic_id The topic id string Y else name 03cV5zI2fk03s N/A
    end_time Timestamp N 2007-03 <current time>
    start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>
    limit the number of results to be returned integer N 40 10
    offset integer N 5 0
    sort flag to indicate the sorting order string N date, relevance date
    source_filter_id daylife source filter id string N 06T8a8lavf8sc None
    source_whitelist one or more name value pairs of Daylife source ids string N source_whitelist=0a0F0VifAodow&source_whitelist=04Ew78S3C96yc None
    block_nsfw flag to indicate if content scored as obscene should be blocked integer N 1 0
    source_blacklist one or more name value pairs of Daylife source ids to exclude from returned results string N source_blacklist=0a0F0VifAodow&source_blacklist=04Ew78S3C96yc None

Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<quote>
			<quote_id type="str">03TWezQa1M85p</quote_id>
			<timestamp_epoch type="int4">1200749352</timestamp_epoch>
			<timestamp type="str">2008-01-19 13:29:12</timestamp>
			<quote_text type="str">But we will still be friends with the 
						Americans and invite them to tea every 
						time they drive through the town
			</quote_text>
			<topic>
				<daylife_url type="str">http://www.daylife.com/topic/Condoleezza_Rice</daylife_url>
				<type type="str">PERSON</type>
				<name type="str">Condoleezza Rice</name>
				<topic_id type="str">01PQ0QsaGm49k</topic_id>
			</topic>
			<source>
				<name type="str">MSNBC</name>
				<url type="str">http://www.msnbc.msn.com/</url>
				<daylife_url type="str">http://www.daylife.com/source/MSNBC</daylife_url>
				<rank type="int4">1</rank>
				<source_id type="str">07yTb3kbhD6Bo</source_id>
				<type type="int4">1</type>
			</source>
			<daylife_url type="str">http://www.daylife.com/quote/03TWezQa1M85p</daylife_url>
			<article>
				<timestamp_epoch type="int4">1200749352</timestamp_epoch>
				<headline type="str">'Awakening' pacts prove complicated</headline>
				<timestamp type="str">2008-01-19 13:29:12</timestamp>
				<url type="str">http://www.msnbc.msn.com/id/22739412/</url>
				<daylife_url type="str">http://www.daylife.com/article/0baOdqcflg2hB</daylife_url>
				<article_id type="str">0baOdqcflg2hB</article_id>
			</article>
		</quote>
		........
		........
	</payload>
</response>

back to top

topic_getTimeline

This method is used to retrieve a digest of daily number of mentions for a topic in mainstream news and blog sources.

Sample Invocation

Input Parameters

    Name Description Type Required Sample Values Default Value
    accesskey string Y <your_access_key> N/A
    signature string Y <calculated_signature> N/A
    topic_id A topic id for the topic in question String Y 045WeJhgDw2Te
    name The topic name string Y George W. Bush N/A
    end_time Timestamp N 2007-03 <current time>
    start_time Timestamp N 2007-05-03 09:00:00, 1178182800 <end_time minus 1 month>

Sample Output

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
		<daily_counts>
			<blog_count type="float">7</blog_count>
			<article_count type="float">88</article_count>
			<timestamp_epoch type="int4">1200700800</timestamp_epoch>
			<timestamp type="str">2008-01-19 00:00:00</timestamp>
			<article>
				<headline type="str">Iraqi troops clash with members of Shiite cult in southern Iraq; nearly 50 dead</headline>
				<url type="str">http://www.macleans.ca/article.jsp?content=w011863A</url>
				<daylife_url type="str">http://www.daylife.com/article/06pr4Qd3DI2ov</daylife_url>
				<article_id type="str">06pr4Qd3DI2ov</article_id>
				<timestamp_epoch type="int4">1200714114</timestamp_epoch>
				<timestamp type="str">2008-01-19 03:41:54</timestamp>
				<excerpt type="str">
					U.S. military spokesman Maj. Brad Leighton said jet fighters flew over the area in a show of
					force after the Iraqi's requested help, but no airstrikes were carried out. Some clashes raged into the night, 
					raising the possibility of more casualties.The
				</excerpt>
				<source>
					<name type="str">Macleans.ca</name>
					<url type="str">http://www.macleans.ca/</url>
					<daylife_url type="str">http://www.daylife.com/source/Macleans.ca</daylife_url>
					<rank type="int4">3</rank>
					<source_id type="str">0a80aBggdl123</source_id>
					<type type="int4">1</type>
				</source>
			</article>
		</daily_counts>
		........
		........
	</payload>
</response>

back to top