Skip to main content
The boolean_query parameter lets you write advanced search expressions using standard boolean operators. It is supported on both the LinkedIn search and database search endpoints.

Supported operators

OperatorDescriptionExample
ANDBoth terms must matchPython AND Java
OREither term can matchReact OR Vue
NOTExclude a termNOT Intern
"..."Exact phrase match"Software Engineer"
( )Group expressions(Python OR Java) AND NOT Angular

Operator precedence

From highest to lowest: NOT > AND > OR. Use parentheses to override.
# Without parentheses — AND binds tighter than OR
Python OR Java AND Senior
# Interpreted as: Python OR (Java AND Senior)

# With parentheses — explicit grouping
(Python OR Java) AND Senior
# Matches profiles with (Python or Java) AND Senior

Examples

Find engineers with specific skills

curl -X POST "https://app.leonar.app/api/v1/sourcing/linkedin/search" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "account_id": "your-account-id",
    "boolean_query": "(Python OR Java) AND \"Software Engineer\" AND NOT Intern"
  }'

Combine boolean query with other filters

boolean_query can be used alongside other filter fields like job_titles, companies, or location_ids. The boolean query applies to the keyword/full-text dimension while other filters apply to their respective structured fields.
curl -X POST "https://app.leonar.app/api/v1/sourcing/linkedin/search" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "account_id": "your-account-id",
    "boolean_query": "\"Machine Learning\" OR \"Deep Learning\" AND NOT PhD",
    "years_experience": { "min": 3, "max": 10 },
    "location_ids": { "103644278": "United States" }
  }'

Search the people database

Boolean queries also work on the database search endpoint:
curl -X POST "https://app.leonar.app/api/v1/sourcing/database/search" \
  -H "Authorization: Bearer leo_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "project_id": "your-project-id",
    "boolean_query": "\"Product Manager\" AND (B2B OR SaaS) AND NOT Junior"
  }'

Common patterns

Use caseQuery
Multiple roles"Software Engineer" OR "Backend Developer" OR "Full Stack"
Skill combination(React OR Angular OR Vue) AND TypeScript
Exclude seniority"Data Scientist" AND NOT (Junior OR Intern OR Entry)
Exact company + role"Goldman Sachs" AND ("Vice President" OR Director)
Industry targeting(FinTech OR "Financial Technology") AND "Head of Engineering"

Syntax rules

  • Operators AND, OR, NOT must be uppercase
  • Parentheses must be balanced
  • Quoted phrases must have matching opening and closing "
  • Operators cannot be consecutive (AND AND is invalid)
  • A query cannot start with AND or OR

Endpoints that support boolean queries

EndpointParameter
POST /sourcing/linkedin/searchboolean_query
POST /sourcing/database/searchboolean_query