Darkrecon
Search Queries
Nested Logical Query

Nested Queries

Complex nested logical queries using AND, OR, NOT operators

NestedQueries Payload

{
  "crawl_date_filter": {
    "crawl_date_from": "2024-07-01"
  },
  "nested_query": {
    "operator": "AND",
    "queries": [
      {
        "operator": "OR",
        "queries": [
          "Market",
          {
            "operator": "AND",
            "queries": [
              "Russia",
              {
                "operator": "NOT",
                "queries": ["English"]
              }
            ]
          }
        ]
      },
      {
        "operator": "OR",
        "queries": ["Credit", "Card"]
      }
    ]
  }
}
 

The Above payload means:

(Market OR (Russia AND NOT English)) AND (Credit OR Card)

Example

import requests
 
url = 'https://api.darkrecon.cloud/dark-recon/search'
headers = {
  'Authorization': 'your api key here',
  'Content-Type': 'application/json'
}
data = {
"crawl_date_filter": {
  "crawl_date_from": "2024-07-01"
},
"nested_query": {
  "operator": "AND",
  "queries": [
    {
      "operator": "OR",
      "queries": [
        "Market",
        {
          "operator": "AND",
          "queries": [
            "Russia",
            {
              "operator": "NOT",
              "queries": ["English"]
            }
          ]
        }
      ]
    },
    {
      "operator": "OR",
      "queries": ["Credit", "Card"]
    }
  ]
}
}
 
 
response = requests.post(url, headers=headers, json=data)
 
print(response.status_code)
print(response.json())