Skip to Content

GET /api/v1/search

Search all ENS names with full-text queries, extensive filters, sorting, and pagination. Supports CSV export for authenticated users. Uses Elasticsearch with automatic PostgreSQL fallback for complex queries.

Authentication: Optional (required for CSV export; enhances results with user-specific data like watchlist status)

Cache: None

Query Parameters

ParameterTypeDefaultDescription
qstring""Search query (full-text match on name)
pagenumber1Page number
limitnumber20Results per page (max 100)
sortBystring—Sort field (see below)
sortOrderstring—asc or desc
exportbooleanfalseSet true to download results as CSV (requires auth)
filenamestringens-exportCSV filename (export mode only)

Sort Fields

price, expiry_date, registration_date, creation_date, last_sale_date, last_sale_price, character_count, watchers_count, view_count, clubs_count, alphabetical, offer, listing_date, listing_expiry, ranking, google_monthly_searches, google_avg_cpc

Note: ranking requires exactly one filters[clubs][] value. watchers_count, view_count, and clubs_count force a PostgreSQL fallback (bypassing Elasticsearch).

Filters

Filters are passed as query parameters in bracket notation: filters[minPrice]=0.1&filters[clubs][]=999

Price & Offer Filters
FilterTypeDescription
filters[minPrice]stringMinimum listing price (wei)
filters[maxPrice]stringMaximum listing price (wei)
filters[minOffer]stringMinimum offer price (wei)
filters[maxOffer]stringMaximum offer price (wei)
Length Filters
FilterTypeDescription
filters[minLength]numberMinimum character count
filters[maxLength]numberMaximum character count
Count Filters
FilterTypeDescription
filters[minWatchersCount]numberMinimum number of watchers
filters[maxWatchersCount]numberMaximum number of watchers
filters[minViewCount]numberMinimum view count
filters[maxViewCount]numberMaximum view count
filters[minClubsCount]numberMinimum number of club memberships
filters[maxClubsCount]numberMaximum number of club memberships
Character Filters (tri-state)
FilterValuesDescription
filters[digits]include, exclude, onlyNames containing digits
filters[letters]include, exclude, onlyNames containing letters
filters[emoji]include, exclude, onlyNames containing emoji
filters[repeatingChars]include, exclude, onlyNames with repeating characters
Legacy Character Filters (boolean)
FilterTypeDescription
filters[hasNumbers]booleanHas numeric characters
filters[hasEmoji]booleanHas emoji characters
String Pattern Filters
FilterTypeDescription
filters[contains]stringName contains substring
filters[startsWith]stringName starts with string
filters[endsWith]stringName ends with string
filters[doesNotContain]stringName does not contain substring
filters[doesNotStartWith]stringName does not start with string
filters[doesNotEndWith]stringName does not end with string
Listing & Market Filters
FilterTypeDescription
filters[listed]booleanHas an active listing
filters[hasOffer]booleanHas an active offer
filters[showListings]booleanOnly show listed names
filters[showUnlisted]booleanOnly show unlisted names
filters[marketplace]stringFilter by marketplace: grails, opensea, or all
Club Filters
FilterTypeDescription
filters[clubs][]string[]Only names in these clubs
filters[excludeClubs][]string[]Exclude names in these clubs
filters[inAnyClub]booleanName is in at least one club
Status Filters
FilterTypeDescription
filters[status]string or string[]registered, grace, premium, available, all (comma-separated for multiple)
filters[isExpired]booleanName has expired
filters[isGracePeriod]booleanName is in grace period
filters[isPremiumPeriod]booleanName is in premium period
filters[expiringWithinDays]numberExpires within N days
filters[includeExpired]booleanInclude expired names in results
Sale History Filters
FilterTypeDescription
filters[hasSales]booleanHas been sold before
filters[lastSoldAfter]stringLast sold after date (ISO)
filters[lastSoldBefore]stringLast sold before date (ISO)
filters[minDaysSinceLastSale]numberMinimum days since last sale
filters[maxDaysSinceLastSale]numberMaximum days since last sale
Other Filters
FilterTypeDescription
filters[minCreationDate]stringCreated after date (ISO)
filters[maxCreationDate]stringCreated before date (ISO)
filters[owner]stringFilter by owner (address or ENS name)
filters[uniqueSeller]booleanDeduplicate results by seller (one listing per seller)

Sample Request

curl "https://api.grails.app/api/v1/search?q=cool&filters[minLength]=3&filters[maxLength]=5&filters[listed]=true&sortBy=price&sortOrder=asc&limit=10"

Response

// 200 OK { "success": true, "data": { "results": [ { "id": 1, "name": "cool.eth", "token_id": "12345...", "owner": "0x1234...", "expiry_date": "2027-01-15T00:00:00.000Z", "registration_date": "2023-01-15T00:00:00.000Z", "creation_date": "2023-01-15T00:00:00.000Z", "last_sale_date": "2025-06-01T00:00:00.000Z", "metadata": { "avatar": "...", "url": "...", "chains": [], "contenthash": null }, "metadata_updated_at": "2026-04-01T00:00:00.000Z", "clubs": ["999", "10k"], "club_ranks": [{ "club": "999", "rank": 42 }], "has_numbers": false, "has_emoji": false, "last_sale_price": "100000000000000000", "last_sale_currency": "0x0000000000000000000000000000000000000000", "last_sale_price_usd": 250.00, "listings": [ { "id": 1, "price": "100000000000000000", "currency_address": "0x0000...", "status": "active", "seller_address": "0x1234...", "order_hash": "0xabc...", "order_data": {}, "expires_at": "2027-01-01T00:00:00.000Z", "created_at": "2026-01-01T00:00:00.000Z", "source": "grails", "broker_address": null, "broker_fee_bps": null } ], "upvotes": 10, "downvotes": 2, "net_score": 8, "user_vote": null, // only present when authenticated "watchers_count": 5, "is_user_watching": false, "watchlist_record_id": null, "highest_offer_wei": "50000000000000000", "highest_offer_currency": "0x0000000000000000000000000000000000000000", "highest_offer_id": 7, "view_count": 42 } ], "pagination": { "page": 1, "limit": 10, "total": 150, "totalPages": 15, "hasNext": true, "hasPrev": false } }, "meta": { "timestamp": "2026-04-07T12:00:00.000Z", "version": "1.0.0" } }

CSV Export

Set export=true to download results as CSV (requires authentication). The response is a CSV file with headers:

name, owner, expiry_date, registration_date, listed, price, currency, and more.

curl -H "Authorization: Bearer YOUR_TOKEN" \ "https://api.grails.app/api/v1/search?q=cool&export=true&filename=my-export"

Error Responses

StatusCodeDescription
401UNAUTHORIZEDExport requires authentication
500SEARCH_ERRORSearch service temporarily unavailable
Last updated on