Asset API

GET /asset

Extended information about a media asset, retrieved by a specific asset id.

Example 1 request:

GET /asset?id=image:366678&api_key=key-XXXXXXXXXXXXX HTTP/1.1
Host: api.dvidshub.net
Accept-encoding: gzip, deflate
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example 1 response:

HTTP/1.1 200 OK
Date: Mon, 23 Sep 2019 15:52:54 GMT
Server: Apache/2.4.41 (Ubuntu)
Access-control-allow-origin: *
Content-length: 1545
Content-type: application/json; charset=utf-8

{
    "results":{
        "id":"image:366678",
        "title":"Tanks",
        "description":"A U.S. Marine Corps M1A1 Abrams Tank with 2nd Tank Platoon, Delta Company, 1st Tank Battalion, attached to Battalion Landing Team 3\/8, 26th Marine Expeditionary Unit, Regimental Combat Team 2, provides over watch out across the desert at Combat Outpost Ouellette, Helmand province, Afghanistan, Jan. 30. Delta Company, 1st Tank Battalion, was the first U.S. tank company to deploy to Afghanistan Elements of the 26th Marine Expeditionary Unit deployed to Afghanistan to provide regional security in Helmand province in support of the International Security Assistance Force.",
        "keywords":"NATO, 26th MEU, Fire Support, International Security Assistance Force, joint operations, ISAF, artillery, Joint Task Force, BLT 3\/8, Battalion Landing Team 3\/8",
        "date_published":"2011-02-13T11:18:00-05:00",
        "date":"2011-01-30T00:00:00-05:00",
        "unit_name":"26th Marine Expeditionary Unit",
        "branch":"Marines",
        "timestamp":"2016-10-21T15:19:52-04:00",
        "image":"https:\/\/cdn.dvidshub.net\/media\/photos\/1102\/366678.jpg",
        "thumbnail":"https:\/\/cdn.dvidshub.net\/media\/thumbs\/photos\/1102\/366678\/122x92_q95.jpg",
        "url":"https:\/\/www.dvidshub.net\/image\/366678\/tanks",
        "credit":[
            {
                "id":1046562,
                "name":"Christopher Matt",
                "rank":"Master Sgt.",
                "url":"https:\/\/www.dvidshub.net\/portfolio\/1046562"
            }
        ],
        "location":{
            "city":"Combat Outpost Ouellette",
            "state":"",
            "country":"Afghanistan",
            "country_abbreviation":"AF"
        },
        "dimensions":{
            "width":"4080",
            "height":"2720"
        },
        "rating":3,
        "virin":"110130-M-4471M-045"
    }
}

Query Parameters:

  • id: Specific document id to retrieve for search. Example: "image:123456". Required.
  • api_key: Public API access key issued by DVIDS (key-xxxxxxxxxxxxx)
  • fields: Comma separated list of which fields to return
  • prettyprint: [1] Spaces out JSON response in more readable format useful for debugging
  • thumb_width: [1-2000] Width of thumbnail in pixels. If thumb_height is provided, this defaults to the aspect ratio native width of the asset relative to the height requested. Otherwise the resolution is 122x92. Max of 2000.
  • thumb_height: [1-2000] Height of thumbnail in pixels. If thumb_width is provided, this defaults to the aspect ratio native height of the asset relative to the width requested. Otherwise the resolution is 122x92. Max of 2000.
  • thumb_quality: [1-100] Quality of generated thumbnail. Default is 95
  • include_related_media: [0,1] If set to 1, includes gallery images with a returned image. News always returns related media. Default is 0.

Status Codes:

  • 200: no error
  • 400: invalid parameter(s) specified. See errors element in response for details.
  • 403: api_key not provided, invalid, or accessed from origin (protocol+domain) other than the one associated with the key provided.
  • 403: asset is not currently published. Per TOS, users are obligated to unpublish these assets and destroy cached entries if asset was previously published.

Response Fields:

  • aspect_ratio :type=video|image: Aspect ratio of the asset
  • branch: Name of branch that produced this asset
  • closed_caption_urls: [array] type=video: Urls to closed caption in available formats if the video has been captioned
  • credit: [array|string] Info about who created the asset or Courtesy if unknown
  • description: Description of asset
  • duration: [int] type=video|audio: length of asset in seconds
  • keywords: Comma separated list of keywords
  • date: Date in ISO8601 format of when the asset was created
  • date_published: Date in ISO8601 format of when the asset was published at DVIDS
  • files: [array] type=video: List of mp4 files associated with asset
  • hls_url: type=video: Url to master m3u8 playlist for asset if video has been encoded for HLS playback
  • id: Asset id of asset retrieved
  • image: type=image: Url to full resolution version of asset, type=video: Url to full resolution frame capture from asset
  • location: [array] Info about where the asset was created. Note country_abbreviation will not be present if it can not be determined.
  • dimensions: [array] type=image: Original dimensions (width and height) of the asset; not available on other assets
  • related_media: [array] Structured info about related media assets. Only available in response for images (if included_related_media=1) and news (always).
  • rating: [float] Rating of the asset. Will not be returned if the asset has not been rated.
  • thumbnail: Url to resized image of asset as specified by thumb_XXX params
  • timestamp: Date in ISO8601 format of when the asset was last updated
  • time_start: [float] type=video: Time at which the content actual content of the video is estimated to start
  • title: Title of asset
  • unit_name: Name of unit that produced this asset
  • url: Url to asset on dvidshub.net
  • views: Number of times the asset has been viewed. Will only be returned if specified in the fields parameter.
  • virin: VIRIN of asset

Example 2 request:

GET /asset?id=video:284392&api_key=key-XXXXXXXXXXXXX HTTP/1.1
Host: api.dvidshub.net
Accept-encoding: gzip, deflate
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example 2 response:

HTTP/1.1 200 OK
Date: Mon, 23 Sep 2019 15:52:55 GMT
Server: Apache/2.4.41 (Ubuntu)
Access-control-allow-origin: *
Content-length: 3230
Content-type: application/json; charset=utf-8

{
    "results":{
        "id":"video:284392",
        "type":"video",
        "title":"Walt Peters - Ramblin' Country Man",
        "description":"U.S. Army Staff Sergeant (Retired) Walt Peters supports Soldiers and Veterans with his music and generosity. Walt was part of the All Soldier Band of which George Strait was also a member. Walt is an inspiration to people he meets in many walks of life. Walt is nearly blind now because of diabetes, but that doesn't stop him from helping to take care of homeless Veterans as well as blind Veterans. His band, The Ramblin' Country Band, uses many of its proceeds to support Walt in his endeavors for the troops in the greater Savannah, Georgia area. Includes interview with Mickey Huggins, Lead Singer & Rhythm Guitarist - Ramblin' Country Band. Also available in high definition.",
        "keywords":"guitar, Veteran, Fort Stewart, 3rd Infantry Division, Homeless veterans, savannah, Vietnam veteran, soldiers, 3rd ID, 2nd Brigade Combat Team, music, Hunter Army Airfield, 2 BCT, support soldiers, Blind Veterans, Walt Peters, All Soldier Band, Ramblin' Country Band, George Strait",
        "date_published":"2013-03-19T00:57:42-04:00",
        "date":"2013-01-11T00:00:00-05:00",
        "category":"Package",
        "unit_id":"23",
        "unit_name":"2nd Brigade Combat Team, 3rd Infantry Division Public Affairs",
        "branch":"Army",
        "timestamp":"2014-05-28T02:09:16-04:00",
        "image":"https:\/\/cdn.dvidshub.net\/media\/frames\/video\/1303\/284392.jpg",
        "url":"https:\/\/www.dvidshub.net\/video\/284392\/walt-peters-ramblin-country-man",
        "credit":[
            {
                "id":1157593,
                "name":"Stephen Dornbos",
                "rank":"Sgt.",
                "url":"https:\/\/www.dvidshub.net\/portfolio\/1157593"
            }
        ],
        "location":{
            "city":"Savannah",
            "state":"Georgia",
            "country":"United States",
            "state_abbreviation":"GA",
            "country_abbreviation":"US"
        },
        "rating":5,
        "time_start":4.13747,
        "virin":"130319-A-FW223-001",
        "duration":396,
        "aspect_ratio":"16:9",
        "files":[
            {
                "src":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434-486x274-300k.mp4",
                "type":"video\/mp4",
                "height":274,
                "width":486,
                "size":18307252,
                "bitrate":300
            },
            {
                "src":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434-720x406-800k.mp4",
                "type":"video\/mp4",
                "height":406,
                "width":720,
                "size":43075778,
                "bitrate":800
            },
            {
                "src":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434-720x406-1500k.mp4",
                "type":"video\/mp4",
                "height":406,
                "width":720,
                "size":77484637,
                "bitrate":1500
            },
            {
                "src":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434-1280x720-3000k.mp4",
                "type":"video\/mp4",
                "height":720,
                "width":1280,
                "size":152515502,
                "bitrate":3000
            },
            {
                "src":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434.mp4",
                "type":"video\/mp4",
                "height":720,
                "width":1280,
                "size":469871403,
                "bitrate":9173
            }
        ],
        "hls_url":"https:\/\/cdn.dvidshub.net\/media\/video\/1303\/DOD_100765434\/DOD_100765434.m3u8",
        "closed_caption_urls":{
            "srt":"https:\/\/api.dvidshub.net\/closed-captions\/get?asset_id=video:284392&format=srt&api_key=key-XXXXXXXXXXXXX",
            "webvtt":"https:\/\/api.dvidshub.net\/closed-captions\/get?asset_id=video:284392&format=webvtt&api_key=key-XXXXXXXXXXXXX"
        },
        "thumbnail":{
            "url":"https:\/\/cdn.dvidshub.net\/media\/thumbs\/frames\/video\/1303\/284392\/122x92_q95.jpg",
            "width":122,
            "height":92
        }
    }
}

GET /asset/related

Basic information about media assets, related to the asset specified, filtered and sorted according to parameters.

Example request:

GET /asset/related?id=video:284392&max_results=2&api_key=key-XXXXXXXXXXXXX HTTP/1.1
Host: api.dvidshub.net
Accept-encoding: gzip, deflate
Accept: application/json, text/javascript
Referer: https://api.dvidshub.net

Example response:

HTTP/1.1 200 OK
Date: Mon, 23 Sep 2019 15:52:55 GMT
Server: Apache/2.4.41 (Ubuntu)
Access-control-allow-origin: *
Content-length: 1758
Content-type: application/json; charset=utf-8

{
    "page_info":{
        "total_results":1000,
        "results_per_page":2
    },
    "results":[
        {
            "publishdate":"2014-07-17T16:23:51Z",
            "date":"2014-07-15T04:00:00Z",
            "width":2226,
            "height":1252,
            "aspect_ratio":"landscape",
            "title":"Walt Sides: Retired Marine larger than life, louder than thunder",
            "id":"image:1451472",
            "type":"image",
            "keywords":"Veteran, P.O.W., M.I.A., Rolling Thunder, Washington, Marine Corps Scout Snipers, Walt Sides",
            "rating":3,
            "country":"Vietnam",
            "city":"",
            "unit_name":"Defense Media Activity - Marines",
            "branch":"Marines",
            "timestamp":"2019-07-18T10:52:37.382Z",
            "short_description":"Walt Sides poses for a photo while on deployment in...",
            "thumbnail":"https:\/\/cdn.dvidshub.net\/media\/thumbs\/photos\/1407\/1451472\/122x92_q95.jpg",
            "url":"https:\/\/www.dvidshub.net\/image\/1451472\/walt-sides-retired-marine-larger-than-life-louder-than-thunder",
            "date_published":"2014-07-17T16:23:51Z"
        },
        {
            "publishdate":"2013-04-23T14:23:58Z",
            "date":"2013-04-19T04:00:00Z",
            "width":4224,
            "height":2408,
            "aspect_ratio":"landscape",
            "title":"New building named in honor of assistant commandant",
            "id":"image:912889",
            "type":"image",
            "keywords":"Marine, dedication, building dedication, Marine Corps Base Quantico, MCIOC, information center, Lewis Walt, Gen. Walt",
            "credit":"Cpl Samuel Ellis",
            "rating":3,
            "country":"United States",
            "state":"Virginia",
            "city":"Marine Corps Base Quantico",
            "unit_name":"Marine Corps Base Quantico",
            "branch":"Marines",
            "timestamp":"2019-07-18T05:57:33.117Z",
            "short_description":"A monument highlighting some of Gen. Lewis Walt's...",
            "thumbnail":"https:\/\/cdn.dvidshub.net\/media\/thumbs\/photos\/1304\/912889\/122x92_q95.jpg",
            "url":"https:\/\/www.dvidshub.net\/image\/912889\/new-building-named-honor-assistant-commandant",
            "date_published":"2013-04-23T14:23:58Z"
        }
    ]
}

Query Parameters:

  • api_key: Public API access key issued by DVIDS (key-xxxxxxxxxxxxx)
  • aspect_ratio: One of 4:3, 16:9, landscape, portrait, square. Only applies to video and image
  • branch: One of Army, Navy, Air Force, Marines, Coast Guard, Joint, Civilian
  • category: One of Combat Operations, Miscellaneous, Afghanistan, Guantanamo, Horn of Africa, Iraq, Kuwait, US, Press Release for news. one of B-Roll, Briefings, Commercials, Greetings, In The Fight, Interviews, Newscasts, Package, PSA, Series for video. one of B-Roll, Briefings, Greetings, Interviews, Newscasts for audio.
  • categories_exclude: Exclude resources with categories specified. You can specify multiple categories with &categories_exclude[]=cat1&categories_exclude[]=cat2
  • city: City where media was captured
  • cocom: One of USAFRICOM, USCENTCOM, USEUCOM, USPACOM, USNORTHCOM, USSOUTHCOM
  • country: Country where media was captured
  • credit: Full name including rank of personnel credited with the media asset.
  • date: Date in ISO8601 format. Example: 2011-02-13T16:18:00Z. Date media was acquired by shooter/producer.
  • duration: [int] Length in seconds of media asset. Only applies to video and audio
  • fields: Comma separated list of which fields to return
  • from_date: Date in ISO8601 format.
  • from_duration: [int] Begin value for duration range query.
  • from_publishdate: Date in ISO8601 format.
  • from_rating: [0-5] Begin value for rating range query.
  • has_image: [0,1] If set to 0, only return media NOT associated with an image. If set to 1, only return media associated with a valid image.
  • has_captions: [1] Limit to videos containing subtitles
  • hash: 32 character hash identifying playlist to retrieve
  • hd: [0,1] If set to 0, only return video media that is NOT considered "HD" (at least 1280x720, 6000kbps or higher). If set to 1, only return video media that meets "HD" criteria.
  • highlight_fields: [0,1] default is 0. Wraps found instances of q parameter with HTML tags for highlighting
  • id: string. Specific document id to retrieve for search. Example: "image:123456"
  • keywords: string. Multiple keywords can be passed in using the syntax &keywords[]=keyword1&keywords[]=keyword2. Will return result if either keyword is found
  • max_results: [1-50] Maximum number of results to return per page. default and maximum value are both 50. If page * max_results > 1000 then the last valid page will be returned given the current max_results
  • page: [int] What page to load. defaults to 1.
  • prettyprint: [1] Spaces out JSON response in more readable format useful for debugging
  • publishdate: Date in ISO8601 format of when the asset was published at DVIDS. This field is deprecated and will be removed in a later version of the api. Use date_published instead
  • q: Fulltext search against title, description, keywords
  • rating: [0-5] Only return media with the specific rating number specified. Note that the majority of media does not have a rating.
  • short_description_length: [1-300] Specify length of short_description up to 300 characters. Defaults to 60.
  • sort: one of date, publishdate, timestamp, score, rating
  • sortdir: One of asc, desc
  • spellcheck: [0,1] Default is 0. Returns a messages element with spelling correction suggestions.
  • state: State where media was captured.
  • tags: Whitespace collapsed version of keywords. Example: army-color-guard. Multiple tags can be passed in using the syntax &tags[]=tag1&tags[]=tag2. Will return result if either tag is found
  • tags_exclude: Exclude resources with tags specified. You can specify multiple tags with &tags_exclude[]=cat1&tags_exclude[]=cat2
  • thumb_width: [1-2000] Width of thumbnail in pixels. If thumb_height is provided, this defaults to the aspect ratio native height of the asset relative to the width requested. Otherwise the resolution is 122x92.
  • thumb_height: [1-2000] Height of thumbnail in pixels. If thumb_width is provided, this defaults to the aspect ratio native width of the asset relative to the height requested. Otherwise the resolution is 122x92.
  • thumb_quality: [1-100] Quality of generated thumbnail. Default is 95
  • timestamp: Date in ISO8601 format. Date/time of last update to asset.
  • title: Match value against the title field of media.
  • to_date: Date in ISO8601 format.
  • to_duration: [int] End value of duration range query.
  • to_publishdate: Date in ISO8601 format.
  • to_rating: [0-5] End value of rating range query.
  • type: One of news, video, image, audio, publication_issue, webcast.
  • unit_name: Full name of unit credited with media asset.
  • unit: DVIDS abbreviation of unit credited with media asset.

Notes: Thumbnails are created on first load. Subsequent request will use cache. Use on larger result sets will take longer to run the first time.


Status Codes:

  • 200: no error
  • 400: invalid parameter(s) specified. See errors element in response for details.
  • 403: api_key not provided, invalid, or accessed from origin (protocol+domain) other than the one associated with the key provided.
  • 503: search is temporarily unavailable

Response Fields:

  • branch: Name of branch that produced this asset
  • credit: Who created the asset
  • category: Category of the asset
  • city: City where the asset was created
  • country: Country where the asset was created
  • duration: [int] type=video|audio: Length of asset in seconds
  • keywords: Comma separated list of keywords
  • date: Date in ISO8601 format of when the asset was created
  • date_published: Date in ISO8601 format of when the asset was published at DVIDS
  • height: [int] type=image: Height of original image
  • id: Asset id
  • publishdate: Date in ISO8601 format of when the asset was published at DVIDS. This field is deprecated and will be removed in a later version of the api. Use date_published instead
  • rating: [float] Rating of the asset. Will not be returned if the asset has not been rated.
  • short_description: Shortened version of asset's description. Currently locked at 60 characters
  • thumbnail: Url to resized image of asset as specified by thumb_XXX params
  • timestamp: Date in ISO8601 format of when the asset was last updated
  • title: Title of asset
  • type: Asset type
  • unit_name: Full name of unit credited with media asset.
  • url: Url to asset on dvidshub.net
  • width: [int] type=image: Width of original image