Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Monitor number of characters transmitted

Not applicable

Is there an option to monitor the number of characters transmitted via specific API calls? I am especially interested in counting the characters that are returned by the API response. This should help me to enable monetization of API's that can be invoiced by character usage (e.g. translation service).

Thanks!

0 1 233
1 REPLY 1

the context variable response.content-length should contain that value, if you are not using chunked transfer-encoding.

If your backend is chunking the response, then you can set up a stream and just count the bytes using a nodejs target or similar.