Logo

Status Page

StatusPage.me Help Center

Popular topics: creating a status page, connecting monitors, automatic incidents, custom domains, integrations and billing.

StatusPage.me Jan 5, 2026 Monitoring

Advanced API Monitoring with JSONPath

When monitoring APIs, sometimes checking the HTTP status code isn’t enough. You might need to verify that specific data is present in the response body or that values meet certain criteria. StatusPage.me supports JSONPath for deep inspection of JSON responses.


What is JSONPath?

JSONPath is a query language for JSON, similar to how XPath is used for XML. It allows you to select specific parts of a JSON structure using a path expression.

Using JSONPath in Monitors

When creating or editing an API Monitor:

  1. In the Advanced expected conditions section, verify you are checking a JSON response.
  2. Add a new condition row.
  3. Select JSON Path as the target.
  4. Enter your JSONPath expression in the path field (usually starting with $.).
  5. Choose an operator (e.g., equals, contains, matches).
  6. Enter the expected value.

Syntax Basics

Our JSONPath implementation supports standard syntax:

  • $ : The root object/element
  • . or [] : Child operator
  • * : Wildcard
  • n:s : Array slice

Examples

Consider this JSON response from a payment API:

{
  "status": "success",
  "data": {
    "balance": 500,
    "currency": "USD",
    "transactions": [
      { "id": 1, "state": "completed" },
      { "id": 2, "state": "pending" }
    ]
  },
  "maintenance": false
}
GoalJSONPath ExpressionExpected ValueCondition
Check status$.statussuccessequals
Check balance$.data.balance500gte
Check maintenance$.maintenancefalseequals
first transaction state$.data.transactions[0].statecompletedequals

Troubleshooting

  • Case Sensitivity: JSON keys and values are case-sensitive.
  • Path Validity: Ensure your path starts with $ to reference the root.
  • Numbers vs Strings: When comparing numbers, ensure you select numerical operators like gte (greater than or equal) or lte if available, though strict equality works for string representations in many cases.

For complex paths, we recommend testing your JSONPath expression against your API response using online tools before configuring your monitor.

Was this article helpful?

Share this article: