---
title: "Search file contents with grep"
method: GET
path: "/search/grep"
tags: ["search"]
---

# Search file contents with grep

`GET /search/grep`

Search file contents in a repository using git grep with regex patterns

## Query parameters

- `repository_id` integer, required
- `pattern` string, required
- `glob` string
- `limit` integer

## Response `200`

OK

- DtoGrepResponse
  - `data` DtoGrepFileSchema[]
    - `language` string
    - `links` DtoGrepFileLinks
      - `file` string
    - `matches` DtoGrepMatchSchema[]
      - `content` string
      - `line` integer
    - `path` string

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.net/helixml/apis/kodit-api.md) · [All operations](https://skmtc.net/helixml/apis/kodit-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/helixml/kodit-api/revisions/3f72fa58f3fb/schema)
