Skip to main content
POST
/
packages
/
grep
Grep package source
curl --request POST \
  --url https://apigcp.trynia.ai/v2/packages/grep \
  --header 'Content-Type: application/json' \
  --data '
{
  "registry": "<string>",
  "package_name": "<string>",
  "pattern": "<string>",
  "version": "<string>",
  "language": "<string>",
  "filename_sha256": "<string>",
  "a": 123,
  "b": 123,
  "c": 123,
  "head_limit": 123,
  "output_mode": "content"
}
'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Body

application/json

Request model for package grep search

registry
string
required

Registry: crates_io, golang_proxy, npm, py_pi, or ruby_gems

package_name
string
required

Package name

pattern
string
required

Regex pattern to search

version
string | null

Package version

language
string | null

Language filter

filename_sha256
string | null

File SHA256 filter

a
integer | null

Lines after match

b
integer | null

Lines before match

c
integer | null

Lines before and after match

head_limit
integer | null

Limit results

output_mode
string
default:content

Output mode: content, files_with_matches, or count

Response

Successful Response