Skip to main content

Hello,

Using the dataset named “ods-api-monitoring”, I am able to know the number of download for a specific dataset. However, I would like to perform this task every month, that’s why I want to automate this process using python. I tried to filter the dataset and take the link of the csv generated in order to upload it on python. Nevertheless, I have an error while launching the program, it seems that it has a link with the authentification on the plateform. 

Do we have access to an API for the dataset “ods-api-monitoring” ?  Or is there another recommended way to retrieve this information?

Thank you for your help.

Best regards,

Eva Berry

I would also like to automate extract of data set usage statistics.


Hello Eva,

The ods-api-monitoring dataset is accessible via the explore API, just like any other dataset. However, you need to have the right permissions:

  • The user issuing the request must have permission to view the analytics

  • The API key used must have permission to view analytics

Let me know if it helps!


Hi Eva and Kira, 
I just would like to add, when you have the right permission, you should be able to access the monitoring repository using this url :

https://YOUR_DOMAIN_ADDRESS/api/explore/v2.1/monitoring

similar to how you use the Explore API to access and retrieve data, you can use the /records and /exports endpoints to consume statistical datasets:

  • ods-api-monitoring 

  • ods-datasets-monitoring

Example url on ods-datasets-monitoring: 

https://YOUR_DOMAIN_ADDRESS/api/explore/v2.1/monitoring/datasets/ods-api-monitoring/records
 

Kind regards, 


Thank you, Yier and Remy -- 

I have Analytics permissions in the back office as I am the main Administrator. However, I do not see the option to view or create an API key in the back end. When I tried to call the endpoint Yier provided, I received a 404 error that it did not exist, so I’m guessing the issue has to do including an API key in the call? 

Thanks,

Kira


I found the API Key creation area under my Account. That was a tricky place to keep it… 


Hi Kira,

It's great that you find where to generate one, api keys are attached to user's account and their permissions. 

It should work now if you add the api key in the end of your query with: 

&apikey=xxxx

Yier

 


Reply