Gen-Endpoint
Back to API List
Advanced Search API
Demonstrates complex querying, filtering, sorting, and pagination with full-text search capabilities.
Data
Internal API - Hosted by this App
API Endpoints & Usage
Explore and interact with the available endpoints for the Advanced Search API. These API routes are live! The paths shown below are relative to your application's base URL. For example, if this application is hosted at https://gen-endpoint.com, an endpoint path for this API, such as /api/search, would be accessible at https://gen-endpoint.com/api/search. You can use the "Try it out" section for each endpoint or use tools like curl, Postman, or your browser's address bar (for GET requests) to interact with them.
GET

/api/search

Multi-field search with filters, sorting, and pagination.

Show Static Examples

Example Request Parameters:

?q=javascript&category=books&sort=price&order=asc&page=1&limit=10

Example Response:

{
  "results": [
    {
      "id": "prod_301",
      "title": "JavaScript: The Good Parts",
      "category": "Books",
      "price": 25.99,
      "relevanceScore": 0.95
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 156
  },
  "filters": {
    "categories": [
      "Books",
      "Electronics"
    ],
    "priceRange": {
      "min": 10,
      "max": 500
    }
  }
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).

POST

/api/search/advanced

Complex search with nested filters, aggregations, and custom scoring.

Show Static Examples

Example Request Body:

{
  "query": {
    "text": "programming",
    "filters": {
      "category": ["Books", "Courses"],
      "price": {"min": 20, "max": 100},
      "rating": {"gte": 4.0}
    }
  },
  "aggregations": ["category", "author", "price_range"]
}

Example Response:

{
  "results": [
    {
      "id": "prod_301",
      "title": "JavaScript: The Good Parts",
      "category": "Books",
      "price": 25.99,
      "relevanceScore": 0.95
    },
    {
      "id": "course_101",
      "title": "Advanced JavaScript Programming",
      "category": "Courses",
      "price": 89.99,
      "relevanceScore": 0.87
    }
  ],
  "aggregations": {
    "category": {
      "Books": 45,
      "Courses": 23
    },
    "price_range": {
      "20-50": 30,
      "50-100": 38
    }
  },
  "totalResults": 68
}
Try it out
GET

/api/search/suggestions

Get search suggestions and autocomplete results.

Show Static Examples

Example Request Parameters:

?q=prog&limit=5

Example Response:

{
  "suggestions": [
    "programming",
    "programs",
    "progress",
    "progressive",
    "programmer"
  ],
  "categories": [
    "Books",
    "Software",
    "Courses"
  ]
}
Try it out

You can add or change query parameters in the path above (e.g., ?name=User).