Introduction to New Relic REST API (v2)

New Relic's REST APIs let you retrieve data from, and push data to New Relic tools, and include configuration and delete capabilities. You can also use the API Explorer to understand the data available to you via the REST API, to obtain curl commands, and to see JSON responses.


To use the REST API you must generate your API keys from your account settings. You can then acquire data via the command line. The command structure follows this template:

curl  -X GET <URL> -H "X-api-key:${API_KEY}" -d '<PAYLOAD>'

The GET command could also be a POST or DELETE, depending on the query intent.

Our examples use curl as a common command line tool to pull metric timeslice data from the REST API. However, you can use any method to make your REST requests. The curl commands include target URLs, header information, and data which are relevant for any request mechanism.


The API calls require a URL to specify the location from which the data will be accessed. You must replace the placeholder <URL> with the appropriate URL which will change depending on the type of data being requested. In general the URL follows this template:${APPID}/metrics/data.json

The ${APPID} specifies the exact application or product for which the data is being requested. The information following this parameter will vary depending on the data request.

If you have an EU region account, the URL is:${APPID}/metrics/data.json

You can retrieve XML data instead of JSON by replacing .json with .xml.

API key ${API_KEY}

New Relic API calls require an API key in the call header. The API key uniquely identifies your account and authorizes access to your account data. New Relic borrows the placeholder ${API_KEY} from Unix shell programming; be sure to replace ${API_KEY} with an API key from your New Relic account.

Query details (PAYLOAD)

The <PAYLOAD> contains the query details, which define:

  • The metric name you want to query and the value you want to retrieve
  • The defined time range for retrieving metrics
  • (Optional): The average of the metric timeslice data by using summarize


See the following documents for example API use cases:

  • APM examples (how to retrieve metric timeslice data from New Relic APM)
  • Browser examples (how to retrieve metric timeslice data from New Relic Browser)
  • Labels examples (how to retrieve information about your labels and categories for apps)
  • Plugin examples (how to retrieve information and metric timeslice data about plugins from New Relic Plugin Central)
  • Alerts examples (create alert conditions and configure notification channels, and more)

For more help

If you need more help, check out these support and learning resources: