q url parameter of the search endpoint (GET /imgs) defines the query filtering formula. This parameter uses a special syntax that allows various filter combinations using boolean operators and supports subfilters for more granular searches.
Filter Syntax
Filters form the fundamental component of the query filtering formula. They adhere to the syntax outlined below:Filter Acronym
Multiple acronyms can refer to the same filterExample:
k, key, keywordsFilter Operator
Defines how the filter is appliedExample:
=, ~, >, <Filter Value
The actual search criteriaExample:
"sunset", 2024-01-01Filter acronym
Each filter can be identified by multiple acronyms. For example, the keyword filter can be referred to by the following acronyms:k, key, keywords.
Filter Operators
Similarity Operators
Similarity Operators
~: Similar (AI semantic search for text/image, subword search for others)~~: Very similar~~~: Super similar
Equality Operators
Equality Operators
=: Equal==: Very equal===: Super equal
Range Comparison
Range Comparison
For numeric filters, dates, and alphabetical order:
<: Less than>: Greater than<=: Less or equal than (Aliases:=<,≤)>=: Greater or equal than (Aliases:=<,≥)
Set Comparison
Set Comparison
=: Must contain all of them∩: Must contain at least one of them (Intersection)
Filter Values
Each filter has a specific format for its values. Here are common examples:
Available Filters and Subfilters
List of available filters and subfilters along with their prefixes:| Filter | Available Acronyms | Available Operators | Value format | Examples |
|---|---|---|---|---|
| Text | t, txt, text | ~, ~~, ~~~ | Free text | t~a red car |
| Image | i, img, image | =, ==, ===, ~, ~~, ~~~ | Image reference | i~123456 |
| Person | p, person | ~, ~~, ~~~ | ImgRef_faceNum | p=taylor swift |
| Date | d, date | =, <, >, <=, >= | YEAR-MONTH-DAY | d>2020-01-01 |
| ID | id | =, <, >, <=, >=, ∩ | Numeric | id=1234 |
| Aspect Ratio | r, ratio | =, <, >, <=, >=, ∩ | Numeric | r<1.5 |
| Num of people | n, n_people | =, <, >, <=, >=, ∩ | Numeric | n=3 |
| AI generated | ai | = | Boolean | ai=true |
| Model Release | mr | = | Boolean | |
| Property Release | pr | = | Boolean | |
| NSFW | nsfw | = | Boolean | nsfw=false |
| Orientation | o, orientation | = | String | o=Horizontal |
| Status | status | = | String | status=Active |
| Author | a, author | = | String | |
| Provider | provider | = | String | |
| Event | e, event | = | String | |
| City | city | = | String | |
| Country | country | = | String | |
| Location | l, location | = | String | |
| Shot | s, shot | = | String | |
| Scene | scene | = | String | |
| Medium level 1 | m1 | = | String | |
| Medium level 2 | m2, medium | = | String | |
| Medium level 3 | m3, technique | = | String | |
| Keywords | k, keywords | =, ∩ | Comma separated | |
| Categories | categories | =, ∩ | Comma separated | |
| Collections | collections | =, ∩ | Comma separated | |
| Color | c, color | = | Color | c=#ff0000 |
Semantic Search
t~us elections - Finds images semantically similar to “us elections”Exact Search
t=us elections - Finds images containing exact text “us elections”Keyword Search
k=us elections - Finds images tagged with “us elections”Date Range
d>2020-03-11 - Finds photographs after March 11, 2020Filter with subfilters
Some filters (imagei, person p, author a) can have subfilters. Subfilter specifies further properties of a filter. Subfilters are defined after the filter containing the “subfilter query formula” between square brackets.
Examples:
p=taylor swift[a=20]search for pictures of Talyor swift at the age of 20 years old.p=taylor swift[t=green dress and cowboy boots]search for pictures of Talyor swift with that clothes.p=donald trump[k=smiling k=lookingToCamera]search for pictures of Donald Trump smiling, looking to camera.p=anyone[a>80]search for pictures of any celebrity with more than 80 years old.a=anyone[g=woman && a>70]search for pictures done by women (women photographer or painters).i=1234[t=at winter]. Considering 1234 the id of a previusly upluaded photo of the stockholm skyline at summer. Ssearch for pictures of Stockholm at Winter- “
Boolean Operators
AND Operator
&& - Both conditions must be trueExample: t=beach && c=blueOR Operator
|| - Either condition can be trueExample: t=beach || t=mountainNOT Operator
! - Excludes the conditionExample: t=beach && !c=blueUse parentheses
() to group filters and control the order of operations.Advanced Query Examples
Basic Text and Color Search
Basic Text and Color Search
Query:
t=beach && c=blueDescription: Search for images of beaches and the color blue.Multiple Options with Exclusion
Multiple Options with Exclusion
Query:
(t=cats || t=dogs) && !m=bw_photoDescription: Search for images of cats or dogs, excluding black and white images.Celebrity with Age and Location
Celebrity with Age and Location
Query:
p=barack obama[a≥40 && a≤50] && l=Washington D.C.Description: Search for images of Barack Obama aged between 40 and 50, taken in Washington D.C.Anonymous Person Demographics
Anonymous Person Demographics
Query:
p=anyone[g=female && a≥30 && a≤40 && (k=smiling || k=wearing glasses)]Description: Search for images of anonymous females aged 30-40, who are smiling or wearing glasses.Celebrity Performance with Color
Celebrity Performance with Color
Query:
( p=taylor swift[t=performing] || p=selena gomez[t=performing] ) && c=redDescription: Search for images of Taylor Swift or Selena Gomez performing on stage, featuring the color red.Location-based Architecture Search
Location-based Architecture Search
Query:
(l=Paris || l=London) && k=gothic architectureDescription: Search for images taken in Paris or London of buildings with Gothic architecture.Similar Image with Modifications
Similar Image with Modifications
Query:
i=54321[t=sunset] && n=0Description: Search for images similar to image REF 54321 with a “sunset” modification, excluding images with people.Activity-based Demographics
Activity-based Demographics
Query:
p=anyone[g=male && a≥30 && a≤40 && (t=running || t=jumping)] && l=New York CityDescription: Search for images of anonymous males aged 30-40, running or jumping, taken in New York City.Aspect Ratio with Scene and Date
Aspect Ratio with Scene and Date
Query:
r=16:9 && t=beach && t=sunset && d=2020-*-*Description: Search for 16:9 aspect ratio images of beaches at sunset, taken in 2020.Multiple Criteria Combination
Multiple Criteria Combination
Query:
k=nature && (m=photograph || m=illustration) && r:4:3Description: Search for images with the keyword “nature,” medium type “photograph” or “illustration,” and aspect ratio 4:3.