Media Cloud

API updates – media health and story counting

Home »  updates »  API updates – media health and story counting

API updates – media health and story counting

On March 30, 2016, Posted by , In updates, With No Comments

We have added a couple new end points to the api and removed some others:

New endpoints

api/v2/mediahealth/list – Return information about the health of a media source, meaning to what degree we are capturing all of the stories published by that media source. We judge health by just comparing the volume of a given time period to the average volume of the 20 busiest weeks for the media source. Details about the meaning of each field below are in the api docs linked above. This is the data used by the latest release of the sources tool to help users assess media source health.

Example:

https://api.mediacloud.org/api/v2/mediahealth/list?media_id=4438

[
    {
        "media_id": "4438",
        "is_healthy": 1,
        "has_active_feed": 1,
        "num_stories": 42,
        "num_stories_w": "28.57",
        "num_stories_90": "30.54",
        "num_stories_y": "33.00",
        "num_sentences": 1200,
        "num_sentences_w": "873.86",
        "num_sentences_90": "877.16",
        "num_sentences_y": "926.83",
        "start_date": "2011-01-03 00:00:00-05",
        "end_date": "2016-02-22 00:00:00-05",
        "expected_stories": "49.97",
        "expected_sentences": "1166.22",
        "coverage_gaps": 1,
        "coverage_gaps_list": [
            {
                "media_id": "4438",
                "stat_week": "2013-12-23 00:00:00-05",
                "num_stories": "12.43",
                "num_sentences": "350.29",
                "expected_stories": "49.97",
                "expected_sentences": "1166.22",
            }
        ],
    }
]

api/v2/stories_public/count – Return the number of stories matching the given query.

Example:

https://api.mediacloud.org/api/v2/stories_public/count?q=sentence:obama&fq=media_id:1

{
  "count" => 960
}

Removed endpoints

The media sets and dashboards functionality has been replaced with tags used for the same purpose.

Comments are closed.