Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousRelational Filtering
NextDynamic Sorting
Data & Query Engine

Full-Text Search Engine

Instantly search across any collection or resource with the global ?q= parameter. Matches case-insensitively across top-level string and numeric fields, as well as deeply nested JSON objects.

Live Search Workbench

Pick a preset search or test custom queries across any resource:

Searches across both "title" and "body" text fields in blog posts.GET /posts?q=optio
Method: GET

Live Request Console

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Search Traversal & Matching Mechanics

How the Playground search engine evaluates queries across records in your session overlay:

Case-Insensitive Substrings

Searching for ?q=laptop matches "Laptops", "Gaming Laptop", and "LAPTOP" identically.

Recursive Object Traversal

The query engine inspects top-level properties and recursively crawls nested child objects (such as address.city or company.bs).

Session Overlay Awareness

Newly created records, local edits, and custom collections in your active visitor session are instantly searchable alongside global baseline data.

Frontend Integration Recipes

Production patterns featuring debouncing, AbortController, and query cancellation:

hooks/useDebouncedSearch.ts
1
// hooks/useDebouncedSearch.ts
2
import { useState, useEffect } from 'react';
3
4
export function useDebouncedSearch<T>(resource: string, query: string, delay = 300) {
5
const [data, setData] = useState<T[]>([]);
6
const [loading, setLoading] = useState(false);
7
const [error, setError] = useState<string | null>(null);
8
9
useEffect(() => {
10
if (!query.trim()) {
11
setData([]);
12
setLoading(false);
13
return;
14
}
15
16
setLoading(true);
17
setError(null);
18
19
// AbortController cancels obsolete inflight requests on fast typing
20
const controller = new AbortController();
21
22
const handler = setTimeout(async () => {
23
try {
24
const res = await fetch(
25
https://playground.nileslabs.com/api/v1/${resource}?q=${encodeURIComponent(query.trim())}`,
26
{
27
signal: controller.signal,
28
credentials: 'include'
29
}
30
);
31
32
if (!res.ok) throw new Error('Search query returned non-200 status');
33
const json = await res.json();
34
setData(json.data || json);
35
} catch (err: any) {
36
if (err.name !== 'AbortError') {
37
setError(err.message || 'Search failed');
38
}
39
} finally {
40
setLoading(false);
41
}
42
}, delay);
43
44
return () => {
45
clearTimeout(handler);
46
controller.abort();
47
};
48
}, [resource, query, delay]);
49
50
return { data, loading, error };
51
}
Next Query Feature

Dynamic Multi-Type Sorting

Related Query Feature

Offset-Based Pagination