Changes to EPU endpoint
Closed this issue · 5 comments
peterdesmet commented
Here's how I would change the EPU endpoint to serve for the charts (#2) as well as the downloads (#12):
Options
format=json or format=csv
start_date=yyyy-mm-dd
end_date=yyyy-mm-dd
Changes:
- The csv option would replace http://epu-index.herokuapp.com/epu-csv, which currently doesn't offer the possibility to get data for a date range (which is a requirement by the client).
- Use
start_date
andend_date
instead of less clearstart
andend
(especially since we'll have another endpoint with justdate
)
Results
[
{
"date": "2002-04-02",
"epu": 3.141592,
"number_of_newspapers": 3,
"number_of_articles": 14
},
{
}
]
Changes:
- Results should be returned in chronological order. This is very helpful for csv downloads and nice to have for json.
number_of_newspapers
,number_of_articles
are required for csv download, and nice to have for json.number_of_papers
is renamed tonumber_of_newspapers
to avoid confusion with scientific "papers"id
is dropped
peterdesmet commented
@bartaelterman can you review and assign to @niconoe when OK.
bartaelterman commented
Agreed.
niconoe commented
Hi guys, that should be it! Please test the new API (at https://epu-index.herokuapp.com/api/epu/) and report any issue or close this ticket.
bartaelterman commented
I tested it. Looks perfect.
@peterdesmet will you give it a final look and close this ticket?
peterdesmet commented
Great, thanks!