> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wistx.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Packages

> Search DevOps/infrastructure packages across registries

Search DevOps/infrastructure packages across registries (PyPI, npm, Terraform Registry, Crates.io, Go, Helm, Ansible Galaxy, Maven Central, NuGet, RubyGems) using semantic, regex, or hybrid search.

<ParamField body="query" type="string">
  Natural language search query (for semantic/hybrid search)
</ParamField>

<ParamField body="pattern" type="string">
  Regex pattern (for regex/hybrid search)
</ParamField>

<ParamField body="template" type="string">
  Pre-built template name (alternative to pattern)
</ParamField>

<ParamField body="search_type" type="string" default="semantic">
  Search type: `semantic`, `regex`, `hybrid`
</ParamField>

<ParamField body="registry" type="string">
  Filter by registry: `pypi`, `npm`, `terraform`, `crates_io`, `golang`, `helm`, `ansible`, `maven`, `nuget`, `rubygems`
</ParamField>

<ParamField body="domain" type="string">
  Filter by domain: `devops`, `infrastructure`, `compliance`, `finops`, `platform`, `sre`
</ParamField>

<ParamField body="category" type="string">
  Filter by category
</ParamField>

<ParamField body="package_name" type="string">
  Search specific package name
</ParamField>

<ParamField body="limit" type="integer" default="1000">
  Maximum results (1-1000)
</ParamField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.wistx.ai/v1/search/packages" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "query": "terraform aws rds module",
      "search_type": "semantic",
      "registry": "terraform",
      "domain": "infrastructure",
      "limit": 1000
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.wistx.ai/v1/search/packages"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }
  data = {
      "query": "terraform aws rds module",
      "search_type": "semantic",
      "registry": "terraform",
      "domain": "infrastructure",
      "limit": 1000
  }

  response = requests.post(url, json=data, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.wistx.ai/v1/search/packages", {
    method: "POST",
    headers: {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      query: "terraform aws rds module",
      search_type: "semantic",
      registry: "terraform",
      domain: "infrastructure",
      limit: 1000
    })
  });

  const data = await response.json();
  console.log(data);
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "net/http"
  )

  func main() {
      url := "https://api.wistx.ai/v1/search/packages"
      data := map[string]interface{}{
          "query": "terraform aws rds module",
          "search_type": "semantic",
          "registry": "terraform",
          "domain": "infrastructure",
          "limit": 1000,
      }
      
      jsonData, _ := json.Marshal(data)
      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
      req.Header.Set("Content-Type", "application/json")
      
      client := &http.Client{}
      resp, _ := client.Do(req)
      defer resp.Body.Close()
  }
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'

  uri = URI('https://api.wistx.ai/v1/search/packages')
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(uri.path)
  request['Authorization'] = 'Bearer YOUR_API_KEY'
  request['Content-Type'] = 'application/json'
  request.body = {
    query: "terraform aws rds module",
    search_type: "semantic",
    registry: "terraform",
    domain: "infrastructure",
    limit: 20
  }.to_json

  response = http.request(request)
  puts response.body
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://api.wistx.ai/v1/search/packages";
  $data = [
      "query" => "terraform aws rds module",
      "search_type" => "semantic",
      "registry" => "terraform",
      "domain" => "infrastructure",
      "limit" => 20
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer YOUR_API_KEY",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);
  echo $response;
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;
  import java.nio.charset.StandardCharsets;

  HttpClient client = HttpClient.newHttpClient();
  String json = "{\"query\":\"terraform aws rds module\",\"search_type\":\"semantic\",\"registry\":\"terraform\",\"domain\":\"infrastructure\",\"limit\":20}";

  HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://api.wistx.ai/v1/search/packages"))
      .header("Authorization", "Bearer YOUR_API_KEY")
      .header("Content-Type", "application/json")
      .POST(HttpRequest.BodyPublishers.ofString(json))
      .build();

  HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
  System.out.println(response.body());
  ```
</CodeGroup>

## Response Example

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "data": {
      "results": [
        {
          "package_id": "terraform:terraform-aws-modules/rds/aws",
          "name": "terraform-aws-modules/rds/aws",
          "registry": "terraform",
          "version": "6.0.0",
          "description": "Terraform module for creating RDS instances",
          "domain": "infrastructure",
          "category": "cloud-providers",
          "github_url": "https://github.com/terraform-aws-modules/terraform-aws-rds",
          "download_count": 50000,
          "stars": 1200,
          "similarity_score": 0.92
        }
      ],
      "total": 1,
      "search_type": "semantic"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123,
      "query_time_ms": 180
    }
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid request parameters",
      "details": "query is required for semantic or hybrid search"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": {
      "code": "UNAUTHORIZED",
      "message": "Invalid or expired token"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 429 Too Many Requests theme={null}
  {
    "error": {
      "code": "QUOTA_EXCEEDED",
      "message": "Query quota exceeded",
      "details": {
        "limit_type": "queries_per_month",
        "current": 1000,
        "limit": 1000
      }
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 500 Internal Server Error theme={null}
  {
    "error": {
      "code": "INTERNAL_ERROR",
      "message": "An unexpected error occurred"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```

  ```json 503 Service Unavailable theme={null}
  {
    "error": {
      "code": "DATABASE_ERROR",
      "message": "Database connection failed"
    },
    "metadata": {
      "request_id": "req_123",
      "timestamp": 1234567890.123
    }
  }
  ```
</ResponseExample>

## Rate Limits

* **Professional**: 2,000 queries/month
* **Team**: 10,000 queries/month
* **Enterprise**: Unlimited queries/month


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.