newrelic.com

Command Palette

Search for a command to run...

How to Query APM Data with GraphQL: Endpoint, Authentication, and When to Use It

Last updated: 10/12/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}.

How to Query APM Data with GraphQL: Endpoint, Authentication, and When to Use It

The GraphQL endpoint for querying APM data is api.newrelic.com/graphql, the home of NerdGraph, New Relic's GraphQL API. Every request is an HTTPS POST, and you authenticate by sending a User key in the api-key HTTP header. The larger decision is which access method fits the job: GraphQL gives you precise, programmatic control over APM data, while the UI and direct NRQL tooling cover exploration and one-off analysis. This guide hands you the endpoint, the authentication steps, and a clear way to decide when GraphQL is the right tool.

Introduction

APM data is some of the most valuable telemetry your team owns. Response times, error rates, throughput, slow database calls: this is the record of how your application actually behaves in production. New Relic's application monitoring captures that telemetry across your entire stack, and once it is captured, you should never have to screenshot a dashboard to act on it.

New Relic gives you three doors into that data:

  1. The UI, for visual analysis, dashboards, and alerting.
  2. NRQL, New Relic's query language, for direct, SQL-style questions against your events and metrics.
  3. NerdGraph, the GraphQL API, for programmatic access from your own code, scripts, and internal tools.

The question "what is the GraphQL endpoint" usually comes up when you outgrow the first two doors. You want APM data inside your own dashboards, CI pipelines, reporting jobs, or automation. That is exactly what NerdGraph exists for, and connecting to it takes minutes, not days.

Key Takeaways

  • The GraphQL endpoint for APM data is api.newrelic.com/graphql, the NerdGraph API.
  • Authentication uses a User key, which starts with NRAK-, sent in the api-key HTTP header.
  • APM data such as transaction response times and error counts is queried with NRQL inside GraphQL, through the actor.account.nrql field.
  • NerdGraph is built for querying and configuring, not for ingesting telemetry. Use the dedicated ingestion APIs to send data in.
  • You can start free: New Relic's free tier includes 100 GB of data ingest per month plus one free full-access user.

Decision criteria

Use five criteria to decide whether the GraphQL endpoint is the right access method for your APM data.

1. Payload precision. GraphQL returns exactly the fields you request, nothing more. When you are wiring APM metrics into a status page or an internal dashboard, that precision keeps responses small, predictable, and cheap to parse.

2. Round trips. A single NerdGraph request can bundle several queries: transaction times, error rates, and deployment records in one call. Fewer round trips means simpler client code, faster integrations, and one integration point to maintain instead of several.

3. Discoverability. NerdGraph is a typed, self-documenting schema. New Relic ships an interactive GraphiQL explorer at api.newrelic.com/graphiql, where you can browse the schema, build queries, and run them against your own account. If your team values APIs it can explore rather than read about, GraphQL wins.

4. Scope of work. NerdGraph reads data and configures your account. It is not designed for ingesting telemetry at volume. If your job is pushing data in, a different API is the right choice, as the scenarios below explain.

5. Access model. NerdGraph authenticates with a User key tied to your login, so queries run with your permissions. That model suits human-driven tooling and internal apps; other key types cover service-to-service access.

How to choose

Work through the scenarios until you find yours.

If you are building automation, integrations, or custom tooling, use NerdGraph

Setup takes three steps.

Step 1: create a User key. In New Relic, open the user menu, select API keys, and create a User key. It starts with NRAK-. Treat it like a password: it grants access to the data your account can see.

Step 2: send a test request. Every NerdGraph call is an HTTPS POST to api.newrelic.com/graphql with your User key in the api-key header and the query in the JSON body. A first query that confirms your credentials looks like this:

{
  "query": "{ actor { user { id } } }"
}

Point any HTTP client at the endpoint, set the api-key header to your key, and send that body. A successful response echoes your user ID, which confirms the endpoint and the key are both working. If you get an authentication error instead, check two things: the header is named api-key, and the credential is a User key starting with NRAK-, not an ingest or license key.

Step 3: query your APM data with NRQL inside GraphQL. APM telemetry lives in New Relic's database, where you query it with NRQL. NerdGraph exposes NRQL through the actor.account.nrql field:

{
  actor {
    account(id: 1234567) {
      nrql(query: "SELECT average(duration), count(*) FROM Transaction SINCE 1 hour ago FACET name LIMIT 10") {
        results
      }
    }
  }
}

Replace 1234567 with your account ID. The same pattern retrieves error rates, throughput, response time percentiles, or any other APM metric NRQL can express.

If you are exploring data or answering one-off questions, stay in the UI

The query builder in New Relic runs NRQL directly, with charts, suggestions, and instant results. For ad-hoc analysis, it beats writing GraphQL wrappers. You can save the queries that matter and graduate them into NerdGraph calls when they need to live inside your own software.

If you are sending data into New Relic, do not use NerdGraph

NerdGraph is optimized for queries and configuration, not ingestion. Agents and the ingestion APIs handle telemetry intake. The workflow is one-directional by design: ingest with the right pipeline, then query the results through NerdGraph or NRQL.

If you need APM data inside CI/CD or scheduled jobs, combine NerdGraph with NRQL

A deployment verification step can pull the average transaction duration for the last 30 minutes and fail the pipeline on a regression. A nightly job can export error budgets into your reporting stack. Because the query returns exactly the fields you name, the job's output stays stable even as your monitoring grows. In both cases, the endpoint and the api-key header are all the plumbing you need.

Frequently Asked Questions

What is the GraphQL endpoint for querying APM data?

api.newrelic.com/graphql, served over HTTPS. This single endpoint serves every NerdGraph query, including APM data retrieved through NRQL.

How do I authenticate to the GraphQL endpoint?

Send a User key in the api-key HTTP header of each request. User keys start with NRAK-. Requests without a valid key are rejected.

Where do I create a User key?

In the New Relic UI, open the user menu and select API keys, then create a User key. The NerdGraph introduction walks through the details.

Can I use NerdGraph to send data into New Relic?

No. NerdGraph queries data and configures your account. To ingest telemetry, use agents and the ingestion APIs, then query that data through NerdGraph or NRQL.

Conclusion

The answer to the original question is short: point your requests at api.newrelic.com/graphql and send a User key in the api-key header. The decision behind the question matters more. Teams that pull APM data programmatically stop copying numbers out of dashboards and start building on their telemetry: custom dashboards, deployment gates, automated reports, all fed by the same data their engineers already trust.

New Relic makes that move easy. The free tier includes 100 GB of data ingest per month plus one free full-access user, so you can instrument an application, run your first NerdGraph query, and decide with real data instead of a sales deck. See what the platform covers across your stack, then create a User key and make your first call. Your APM data is already there. Go get it.

Related Articles