
The DayPI Source calls return articles, quotes and connections from content published by one or more sources. These APIs are only available for DayPI version 4.4 and above.
You can download a list of source names and source IDs here -
http://cookbook.daylife.com/sites/default/files/all_sources_20080605.xls
http://cookbook.daylife.com/sites/default/files/all_sources_20080605.csv
This method is used to retrieve articles published by one or more sources. You can provide a list of source ids or source names as an multiple name value pairs in the input. Here is how you calculate the signature for multiple input values.
Sample Invocation
http://freeapi.daylife.com/xmlrest/publicapi/4.4/source_getArticles?
accesskey=<accesskey>&signature=<signature>
&name=The%20New%20York%20Times&name=The%20Washington%20Post&limit=2
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 | |
| source_id | The source id or a list of name-value pairs of source ids | string | Y if name not provided | 03cV5zI2fk03s | N/A |
| name | The source name or a list of name-value pairs of source names |
string | Y if source_id not provided | 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 | |
| include_image | Flag to indicate if one related scraped image should be returned if available. | integer | N | 0 or 1 | 0 |
| include_scores | Flag to indicate if enhanced score data should be included for every article if available. | 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> </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> <query_term type="str">07vgers9mJayf</query_term> <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>
This method is used to retrieve topics mentioned in the aritlces published by one or more sources. You can provide a list of source ids or source names as an multiple name value pairs in the input. Here is how you calculate the signature for multiple input values.
Sample Invocation
http://freeapi.daylife.com
accesskey=<accesskey>&signature
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 | |
| source_id | The source id or a list of name-value pairs of source ids | string | Y if name not provided | 03cV5zI2fk03s | N/A |
| name | The source name or a list of name-value pairs of source names | string | Y if source_id not provided | N/A | |
| limit | The number of results to be returned | integer | N | 40 | 10 |
| offset | integer | N | 5 | 0 | |
| sort | Flag to indicate the sorting order To be implemented in future. | string | N | date, relevance | date |
| include_topic_type | A comma separated list of types of topics that should be returned | string | N | person or place or organization or a comma separated list of any of their combinations | person,place,organization |
| include_image | Flag that indicates if a thumbnail image for each topic should be returned if available. | integer | 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>
This method is used to retrieve information about one or more sources. You can provide a list of source ids or source names as an multiple name value pairs in the input. Here is how you calculate the signature for multiple input values.
Sample Invocation
http://freeapi.daylife.com/xmlrest/publicapi/4.4/source_getInfo?
accesskey=<accesskey>&signature=<signature>&article_id=07vgers9mJayf
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 | |
| source_id | The source id or a list of name-value pairs of source ids | string | Y if name not provided | 03cV5zI2fk03s | N/A |
| name | The source name or a list of name-value pairs of source names | string | Y if source_id not provided | N/A |
Sample Output:
<response> <message type="str">Success</message> <code type="int4">2002</code> <payload> <source> <name type="str">The New York Times</name> <url type="str">http://www.nytimes.com/</url> <daylife_url type="str">http://www.daylife.com/source/The_New_York_Times</daylife_url> <rank type="int4">1</rank> <source_id type="str">0a0F0VifAodow</source_id> <type type="int4">1</type> </source> </payload> </response>