Skip to main content
The 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><filter operator><filter value>

Filter Acronym

Multiple acronyms can refer to the same filterExample: k, key, keywords

Filter Operator

Defines how the filter is appliedExample: =, ~, >, <

Filter Value

The actual search criteriaExample: "sunset", 2024-01-01

Filter 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

  • ~: Similar (AI semantic search for text/image, subword search for others)
  • ~~: Very similar
  • ~~~: Super similar
  • =: Equal
  • ==: Very equal
  • ===: Super equal
For numeric filters, dates, and alphabetical order:
  • <: Less than
  • >: Greater than
  • <=: Less or equal than (Aliases: =<, )
  • >=: Greater or equal than (Aliases: =<, )
  • =: 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:
YEAR-MONTH-DAY
Example: d=2005-5-13

Available Filters and Subfilters

List of available filters and subfilters along with their prefixes:
FilterAvailable AcronymsAvailable OperatorsValue formatExamples
Textt, txt, text~, ~~, ~~~Free textt~a red car
Imagei, img, image=, ==, ===, ~, ~~, ~~~Image referencei~123456
Personp, person~, ~~, ~~~ImgRef_faceNump=taylor swift
Dated, date=, <, >, <=, >=YEAR-MONTH-DAYd>2020-01-01
IDid=, <, >, <=, >=, Numericid=1234
Aspect Ratior, ratio=, <, >, <=, >=, Numericr<1.5
Num of peoplen, n_people=, <, >, <=, >=, Numericn=3
AI generatedai=Booleanai=true
Model Releasemr=Boolean
Property Releasepr=Boolean
NSFWnsfw=Booleannsfw=false
Orientationo, orientation=Stringo=Horizontal
Statusstatus=Stringstatus=Active
Authora, author=String
Providerprovider=String
Evente, event=String
Citycity=String
Countrycountry=String
Locationl, location=String
Shots, shot=String
Scenescene=String
Medium level 1m1=String
Medium level 2m2, medium=String
Medium level 3m3, technique=String
Keywordsk, keywords=, Comma separated
Categoriescategories=, Comma separated
Collectionscollections=, Comma separated
Colorc, color=Colorc=#ff0000
Quick Examples:

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, 2020

Filter with subfilters

Subfilters are not ready yet. They will be available in future releases of Wesog Search.
Some filters (image i, 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

You can combine filters using Boolean logic to create complex search queries.

AND Operator

&& - Both conditions must be trueExample: t=beach && c=blue

OR Operator

|| - Either condition can be trueExample: t=beach || t=mountain

NOT Operator

! - Excludes the conditionExample: t=beach && !c=blue
Use parentheses () to group filters and control the order of operations.

Advanced Query Examples

Query: (t=cats || t=dogs) && !m=bw_photoDescription: Search for images of cats or dogs, excluding black and white images.
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.
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.
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.
Query: i=54321[t=sunset] && n=0Description: Search for images similar to image REF 54321 with a “sunset” modification, excluding images with people.
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.
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.
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.