Skip to main content
JSON filtering allows you to extract specific values from JSON responses, whether from APIs or JSON embedded in HTML pages. changedetection.io supports both JSONPath and jq for flexible JSON querying.

How JSON Filtering Works

When you apply a JSON filter, changedetection.io:
  1. Fetches the content from the URL
  2. Parses the JSON (either pure JSON or extracts it from HTML)
  3. Applies your filter to extract specific values
  4. Formats the output for monitoring
  5. Detects changes in the extracted data
Key Benefits:
  • Monitor API responses for changes
  • Extract nested data structures
  • Filter and transform JSON data
  • Parse JSON embedded in HTML (like LD+JSON)
  • Use logical operations to filter results

Filtering Methods

changedetection.io supports three JSON filtering syntaxes:
Prefix: json:Library: jsonpath-ngBest for: Simple to moderate JSON queriesExample:

JSONPath Syntax

Basic Selection

Access nested properties with dot notation.
Select all names from products array.
Recursive descent - finds all price fields at any level.

Array Access

First item in array.
Last item in array.
Slice - first three items.

Filtering

Filter products where price is less than 100.
Filter books by author.

jq Syntax

Basic Selection

Access nested properties.
Extract all prices from products array.

Filtering with select()

Filter products under $100.
Get names of items in stock.

Transformations

Extract array of all prices.
Create new objects with selected fields.
Sum all prices.

Practical Examples

Monitor API Price

Extract Multiple Fields

Each filter on a new line extracts different fields.

Monitor Array of Items

Embedded JSON in HTML

changedetection.io can automatically extract and parse JSON embedded in HTML pages, particularly useful for:
  • LD+JSON (Linked Data JSON) - Structured data for SEO
  • Application State - JavaScript state stored in script tags
  • API Data - JSON embedded for client-side rendering

LD+JSON Product Data

changedetection.io automatically detects and parses <script type="application/ld+json"> tags. Just use your JSON filter as if you were querying the JSON directly.

Multiple JSON Blocks

If the HTML contains multiple JSON blocks:
changedetection.io will search through all blocks and return the first matching result.

Advanced Filtering

Finds products under $100 that are in stock.
Filters items by multiple categories.
Navigates through nested objects.
Accesses deeply nested fields.
Calculates average price.
Finds cheapest item.
Groups and counts by category.
Returns different values based on conditions.
Only outputs names of products under $50.

Output Formatting

Single Value

When your filter returns a single value:
Output: 29.99 (unquoted number)

Multiple Values

When your filter returns multiple values:
Output:

String Values

Output: "Gaming Laptop" (includes quotes) Use jqraw: prefix to get unquoted strings:
Output: Gaming Laptop

Testing JSON Filters

Using Online Tools

JSONPath: jq:
  • jq play
  • Interactive jq playground

Using Browser Console

  1. Open DevTools Console (F12)
  2. Fetch and test your JSON:
  3. Examine structure and test paths

Common Patterns

Pattern: Extract Nested Price

Use case: Product pricing from structured data.

Pattern: Monitor Stock Status

Use case: Track product availability.

Pattern: Track Multiple Products

Use case: Monitor product catalog.

Pattern: Filter Price Range (jq)

Use case: Find mid-range products.

Pattern: Count Items (jq)

Use case: Track number of available items.

Common Pitfalls

Pitfall #1: Forgetting the Prefix
Correct:
Pitfall #2: Path Not FoundIf your filter returns nothing:
  1. Verify JSON structure (use browser DevTools)
  2. Check for typos in property names
  3. Ensure arrays use correct syntax: [*] or []
  4. Try recursive descent: $..property_name
Pitfall #3: Wrong Filter Type
Use jq instead:
Or JSONPath:
Pitfall #4: jq Not Availablejq requires compilation and may not be available on Windows.Fallback: Use JSONPath for cross-platform compatibility:

When to Use JSON Filtering

Good for:
  • Monitoring REST APIs
  • Tracking prices from JSON endpoints
  • Extracting structured data from HTML (LD+JSON)
  • Processing JSON with logical filtering
  • Monitoring nested data structures
Not ideal for:

JSONPath vs jq

Real-World Examples

Track repository stars from GitHub API.
Monitor open issues count.
Extract Bitcoin price in USD from crypto API.
Alternative structure from different API.
Alerts when stock is low (under 10 units).
Extract temperature and conditions from weather API.
Filter remote job titles from job board API.

Combining with Other Filters

You can combine JSON filtering with other features:

Ignore Text

After extracting JSON data, filter out unwanted values: Filter: json:$.products[*].name Ignore text: Discontinued

Trigger Keywords

Trigger only when specific values appear: Filter: json:$.status Trigger text: Available, In Stock

Extract Text (Regex)

Further process extracted JSON values: Filter: json:$.price Extract text: /\d+\.\d{2}/ (extract just the number)

Debugging Tips

No Output

  1. Verify URL returns valid JSON (check in browser)
  2. Test filter in online JSONPath/jq playground
  3. Check for typos in property names
  4. Try recursive descent: $..property
  5. Enable browser-based fetching if JSON is loaded dynamically

Unexpected Output Format

  1. Single value returns without array brackets
  2. Multiple values return as JSON array
  3. Use jqraw: for unquoted string output
  4. Check if your path is too broad ($..price finds ALL prices)

Parsing Errors

  1. Ensure content-type is JSON or contains valid JSON
  2. Check for BOM (Byte Order Mark) issues
  3. Verify JSON is not wrapped in extra markup
  4. For HTML-embedded JSON, ensure <script type="application/ld+json"> is correct