Search API

Full-text search across all skills.

Search Skills

GET /api/v1/skills/search

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | q | string | Search query (required) | | page | number | Page number (default: 1) | | limit | number | Items per page (default: 20) | | category | string | Filter by category | | platform | string | Filter by platform | | minStars | number | Minimum star count | | hasIndex | boolean | Has marketplace.json |

Example Request

bash
curl "https://skillsmp.com/api/v1/skills/search?q=react+typescript&category=frontend&minStars=100"

Example Response

json
{
  "data": [
    {
      "id": "456",
      "owner": "community",
      "repo": "react-typescript-guide",
      "name": "React TypeScript Guide",
      "description": "Type-safe React development patterns",
      "stars": 890,
      "score": 15.7,
      "highlights": {
        "name": "<mark>React</mark> <mark>TypeScript</mark> Guide",
        "description": "Type-safe <mark>React</mark> development patterns"
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "totalPages": 3
  },
  "meta": {
    "query": "react typescript",
    "took": 23
  }
}

Search Syntax

react components

Searches all text fields for these terms.

Exact Phrase

"react hooks"

Matches the exact phrase.

Field-Specific

name:react description:hooks

Search specific fields.

Exclusion

react -class

Exclude terms with minus.

Wildcards

react*

Prefix matching.

Search Tips

Effective Queries

Good:

  • react hooks state management - Specific terms
  • "code review" security - Phrase + term
  • typescript name:react - Field-specific

Less Effective:

  • the best react skill - Stop words ignored
  • r - Too short
  • * - Too broad

Relevance Scoring

Results are ranked by:

  1. Exact match - Full term matches
  2. Field weight - Name > Description > Content
  3. Popularity - Star count boost
  4. Freshness - Recent updates boost

Autocomplete

GET /api/v1/skills/autocomplete

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | q | string | Partial query | | limit | number | Max suggestions (default: 5) |

Example Request

bash
curl "https://skillsmp.com/api/v1/skills/autocomplete?q=rea"

Example Response

json
{
  "data": [
    {
      "text": "react",
      "count": 89
    },
    {
      "text": "react hooks",
      "count": 34
    },
    {
      "text": "react typescript",
      "count": 28
    }
  ]
}

Error Handling

| Code | Description | |------|-------------| | INVALID_QUERY | Query is empty or too short | | QUERY_TOO_LONG | Query exceeds 200 characters | | INVALID_SYNTAX | Malformed search syntax |