---
title: "Go Modules API: Search Go packages | Perceptlayer"
description: "Go packages on pkg.go.dev matching a query, with module, version, synopsis and how many packages and modules import them."
url: https://perceptlayer.com/apis/go-modules/search
---

[APIs](https://perceptlayer.com/apis) / [Go Modules](https://perceptlayer.com/apis/go-modules) / Search Go packages

# Go Modules: Search Go packages

Go packages on pkg.go.dev matching a query, with module, version, synopsis and how many packages and modules import them.

GET `/v1/go-modules/search`

## Parameters

Send parameters in the query string.

| Parameter | Type | Required | Allowed values |
| --- | --- | --- | --- |
| `query` | string | Required | Up to 200 characters Words to match in package paths and documentation. |
| `limit` | integer | Optional | Any Results to return, 1 to 100. Default 20. |
| `page_token` | string | Optional | Up to 512 characters next\_page\_token from the previous response, for the next page. |

## Example request

Go Modules

GET /v1/go-modules/search?query=yaml&limit=10 

```
{
  "success": true,
  "data": {
    "total": 1000,
    "has_more": true,
    "next_page_token": "bf219618e419755eaba216f67d3dd243",
    "count": 10,
    "items": [
      {
        "package": "gopkg.in/yaml.v2",
        "module": "gopkg.in/yaml.v2",
        "version": "v2.4.0",
        "synopsis": "Package yaml implements YAML support for the Go language.",
        "imported_by_packages": 60161,
        "imported_by_modules": 43006,
        "url": "https://pkg.go.dev/gopkg.in/yaml.v2"
      },
      {
        "package": "gopkg.in/yaml.v3",
        "module": "gopkg.in/yaml.v3",
        "version": "v3.0.1",
        "synopsis": "Package yaml implements YAML support for the Go language.",
        "imported_by_packages": 44731,
        "imported_by_modules": 42641,
        "url": "https://pkg.go.dev/gopkg.in/yaml.v3"
      },
      {
        "package": "sigs.k8s.io/yaml",
        "module": "sigs.k8s.io/yaml",
        "version": "v1.6.0",
        "imported_by_packages": 12078,
        "imported_by_modules": 6258,
        "url": "https://pkg.go.dev/sigs.k8s.io/yaml"
      }
    ]
  },
  "meta": {
    "request_id": "req_4f669232d0204d1e95c977e643e9bf88",
    "credits_charged": 1,
    "credits_remaining": 457
  }
}
```

200 OK JSON X-Credits-Used: 1

Recorded from our API and shortened.

[Run this endpoint in the playground](https://perceptlayer.com/apis/go-modules?try=search#playground) with your own parameters. 1 credit per successful call; failed calls are free.

## Response fields

Each item in `data.items` has these 7 fields, read from a recorded call. The recording leaves out fields that were empty, so a live call can return more.

| Field | Type |
| --- | --- |
| `package` | string |
| `module` | string |
| `version` | string |
| `synopsis` | string |
| `imported_by_packages` | integer |
| `imported_by_modules` | integer |
| `url` | url |
