Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Count calls for an external service in a time frame


We have an app that calls multiple external services (we are marketplace platform that gathers products from multiple external sources).

One of the providers want us to tell him how many calls we have been doing to his API, he points out an specific timeframe he wants to know, but we don’t know how to NRQL that.

example external API

SELECT COUNT() FROM ExternalTransactions WHERE url LIKE “%
) FROM ExternalTransactions WHERE url = “

Can this be done?


Hi, @silva96: ExternalTransactions is not a standard event type; are you capturing it as a custom event? If so, then yes, your query examples should work, but we cannot help you with them, because we don’t know what attributes you are passing with each event.

If you are using distributed tracing, you may be able to get the desired data by querying Span events:

SELECT count(*) 
FROM Span 
WHERE `http.url` LIKE ''
SINCE starttime UNTIL endtime


EcternalTransaction doesn’t exist… Was an example for you to tell me the real way of doing it. I don’t know if I have distributed tracing, I’ll check


OK. If you are not using distributed tracing, New Relic APM does not record individual external service calls, so you would have to add code to create a custom event for each call.