Select to view content in your preferred language

Tracking and Exporting API Usage by "Channel"

1732
7
06-21-2022 01:45 PM
Labels (1)
DanielDormont
Regular Contributor

Hi,

I've been migrating some applications from the Google Maps Platform to ArcGIS Platform and ran into a question on how to track my users' usage in the platform. Google has something called "channels" in which an individual API request or client session can be associated with a unique channel ID that can then be used in reporting.

Is there any similar concept in ArcGIS Platform? From searching the docs nothing seems to have jumped out.

On a related note, is there a way to export usage data from the platform grouped by different criteria, for example API Keys? The graph on https://developers.arcgis.com/usage is nice but I'm hoping to do a bit more with the data.

Finally, is there an API of some sort that can generate new API keys? That could be an interesting approach too. But I can't find anything like that in the developer documentation.

Thanks,
Dan

0 Kudos
7 Replies
DanielDormont
Regular Contributor

Any thoughts on this? Or any other resource where I can get more information on the topic of monitoring usage and API keys?

0 Kudos
Raul_Jimenez
Esri Contributor

Hi Daniel,

Is there any similar concept in ArcGIS Platform?

You are right, we don't provide a similar mechanism to segment usage :(.

BTW: I think this is a nice idea that should be posted to ArcGIS Developers' ideas. Only customers can post there, and if the idea gets enough "Kudos" it get more chances to be implemented.

Related to this question:

 is there a way to export usage data from the platform grouped by different criteria, for example API Keys? 

There are a set of endpoints for usage reports ("related" question) but I don't think that's what you are looking for (it is related to ArcGIS Online and Enterprise organization reports not to API keys). We are also planning to upload a short video next week related to this in ArcGIS Developer account management. In the meantime you can check this python script that uses the Billing API to get usage statistics for each API key

is there an API of some sort that can generate new API keys? That could be an interesting approach too. But I can't find anything like that in the developer documentation.

You are also right, this is not documented and we are working to provide a single endpoint to generate API keys with one call but it is not ready yet. But you can generate an API key from your dashboard and check the network request to find how these are created today. I hope that helps

Thanks,
Raul

P.S. I'm also going to open an internal issue to create better documentation around advanced and programmatic usage tracking by API key.

0 Kudos
Marc_Graham
Frequent Contributor

Hi @Raul_Jimenez ,

Please add me to this ticket. I would love to see some improved documentation for the billing api.  We are extracting usage statistics for each API key using FME and an adaptation of the postman/scripts you posted earlier.  However we are struggling to get the numbers to match exactly to what we are seeing in the billing page on Platform.

I also don't understand exactly what I am seeing, why for each API key we get multiple results with different units, and some have costs and some don't.

MarcGraham2_0-1702586545182.png

Regards,

Marc

 

Raul_Jimenez
Esri Contributor

Hi @DanielDormont,

Were you able to solve this?. 

I also wanted to give you a quick update about this. We are already working on improving the documentation. I don't know if you heard about this Postman collection we made, I hope you find it useful.

If you have any additional feedback, let us know // cc: @AnitaKemp

Related questionManaging API Keys at an Organizational Level

0 Kudos
DanielDormont
Regular Contributor

Hi @Raul_Jimenez thanks for following up. I ended up doing something kind of different instead, in which I basically keep my own database table to track usage and just use one API key for all of my backend geocoding tasks.

 

In the end the biggest issue I ran into (and I think I made another post about this elsewhere) is that Developer / Platform accounts are not able to create multiple users or identities in the "organization". So that means that even to let my application do something as seemingly simple as create a new API Key, I'd have to literally put my own personal credentials, that are tied to my billing account, cases, My Esri, Partner Community etc., into my production environment. That's not something I'm able to do.

 

Dan

0 Kudos
Raul_Jimenez
Esri Contributor

Thanks Dan, we really appreciate the feedback.

Yes, you are right, I know the team is working to improve that, so I hope we can soon give you a better solution for that soon.

Bests,
Raul

0 Kudos
DanielDormont
Regular Contributor

Thanks. I suppose you could argue that I should have created a new public account purely for the Developer / Platform stuff and then those credentials would not be tied to any of the other things I mentioned, but I was not at all familiar with the ArcGIS ecosystem when I first signed up so that wasn't clear to me. And the billing issue would still be there.

Perhaps that's the issue though: that most of the documentation assumes ArcGIS Platform is for existing ArcGIS Online developers looking to expand their offerings, whereas I was an existing application developer with no prior ArcGIS experience looking for a cloud-based location services provider.