SEARCH

// developer.daylife.com


Content Calls



The Content API method calls return data related to a given piece of content.


content_getTopics

This method retrieves topics that are mentioned in the given piece of text.

Sample Invocation

    http://freeapi.daylife.com/xmlrest/publicapi/4.10/content_getTopics?
    accesskey=<accesskey>&signature=<signature>&
    content=Barack%20Obama%20is%20the%20new%20president%20of%20United%20States%20of%20America

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
content Text to extract topics from. Core input for generating the signature for this call.
Can contain up to 20,000 characters.
string Y President Obama announced on Tuesday that he will nominate the federal appeals judge Sonia Sotomayor for the Supreme Court, choosing a daughter of Puerto Rican parents raised in a Bronx public housing project to become the nation’s first Hispanic justice. N/A
link_content Flag to indicate whether to return content with links to topics embedded within the content
Integer N 0 - Do Not Link,
1 - Link the first appearance of all topics in the content
1
limit The number of results to be returned integer N 40 10
link_prefix Base URL to prefix when embedding links to topics in the content string N http://www.daylife.com/topic /topic
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

 Sample Output:

<response>
	<message type="str">Success</message>
	<code type="int4">2001</code>
	<payload>
        <content type="str">Barack Obama is the new president of United States of America.</content>
	<topic>
		<topic_id type="str">0dVm3LAbhJbES</topic_id>

		<content_topic_relevance type="str">5</content_topic_relevance>

		<type type="str">PLACE</type>
		<name type="str">United States</name>
		<topic_url type="str">/topic/United_States</topic_url>
                <topic_id type="str">0dVm3LAbhJbES</topic_id>
                <location>
                        <original_text type="str">United States</original_text>
                        <start type="int4">37</start>
                        <end type="int4">49</end>
                </location>
                <linked_content type="str">
                        <a href="/topic/Barack_Obama">Barack Obama</a> is the new president of <a href="/topic/United_States">United States</a> of America.
                </linked_content>
	</topic>
		........
		........
	</payload>
</response>

back to top




content_getRelatedArticles

This method retrieves articles related to a piece of text, which can be an article text, a blog post text, an image caption or a video caption and/or transcript.

Sample Invocation

    http://freeapi.daylife.com/xmlrest/publicapi/4.10/content_getRelatedArticles?
    accesskey=<accesskey>&signature=<signature>&
    content=Barack%20Obama%20is%20the%20new%20president%20of%20United%20States%20of%20America

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
content Text to get articles related to. . Core input for generating the signature for this call.
Can contain up to 20,000 characters.
string Y President Obama announced on Tuesday that he will nominate the federal appeals judge Sonia Sotomayor for the Supreme Court, choosing a daughter of Puerto Rican parents raised in a Bronx public housing project to become the nation’s first Hispanic justice. 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 relevance
source_filter_id daylife source filter id string N 06T8a8lavf8sc None
threshold minimum article-article relevance score for returned item. If you are using sort=date, recommend using threshold=3 and higher (0 to 10) integer N 1, 10 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

 

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