public_api_specs
public_api_specs copied to clipboard
Most Popular API : incoherent type when empty value
Hello,
In the Most Popular API, the media element of an article is an empty string instead of an empty array. This causes type issues when parsing.
This issue seems to have been solved as I don't get empty media elements anymore.
This is happening again. To bring an exemple, this is an article with an empty media attribute, copied from a Most Popular API response :
{"url":"https:\/\/www.nytimes.com\/interactive\/2017\/10\/04\/opinion\/thoughts-prayers-nra-funding-senators.html","adx_keywords":"","column":"","section":"Opinion","byline":"By DAVID LEONHARDT, IAN PRASAD PHILBRICK and STUART A. THOMPSON","type":"Interactive","title":"The Congress Members Receiving the Most N.R.A. Funding","abstract":"Thoughts and prayers and the N.R.A.: Here are the top career recipients of N.R.A. campaign money.","published_date":"2017-10-04","source":"The New York Times","id":100000005478110,"asset_id":100000005478110,"views":3,"des_facet":["GUN CONTROL"],"org_facet":["NATIONAL RIFLE ASSN","SENATE","HOUSE OF REPRESENTATIVES"],"per_facet":"","geo_facet":"","media":""}
This is happening again ! http://api.nytimes.com/svc/mostpopular/v2/mostviewed/all-sections/7.json?apikey=XYZ
{
"url":"https://www.nytimes.com/2018/05/17/style/royal-wedding-time-date.html",
"adx_keywords":"Royal Wedding;Weddings and Engagements;Time;Harry, Prince of Wales;Markle, Meghan",
"column":null,
"section":"Style",
"byline":"By THE NEW YORK TIMES",
"type":"Article",
"title":"What Time Was the Royal Wedding in My Time Zone?",
"abstract":"Interesting news: The royal wedding is now in the past. ",
"published_date":"2018-05-17",
"source":"The New York Times",
"id":100000005904642,
"asset_id":100000005904642,
"views":4,
"des_facet":[
"WEDDINGS AND ENGAGEMENTS",
"TIME"
],
"org_facet":"",
"per_facet":[
"HARRY, PRINCE OF WALES",
"MARKLE, MEGHAN"
],
"geo_facet":"",
"media":""
},
It is a moving 24 hour window that is updated every 20 minutes. So currently window is 8:40pm Saturday to 8:40pm Sunday. In 20 minutes it will calculate the window 9pm yesterday to 9pm today.