Search API

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Use this API to search across GitLab. Every call to this API requires authentication.

Some scopes are available for basic search. When advanced search or exact code search is enabled, additional scopes are available for global search, group search, and project search operations.

If you want to use basic search instead, see specify a search type.

The search API supports offset-based pagination.

With advanced search, you can retrieve up to 10,000 results (page multiplied by per_page). Requests past that limit return an empty page with no next link, so a client that pages until it gets an empty response stops at the limit. Basic search and exact code search are not affected. Raising index.max_result_window on your Elasticsearch cluster does not increase the limit because GitLab does not read that setting.

Search an instance

Search for a term across the entire GitLab instance. The response depends on the requested scope.

GET /search
Attribute Type Required Description
scope string Yes The scope to search in. Values include projects, groups, issues, work_items, merge_requests, milestones, snippet_titles, and users. Additional scopes are wiki_blobs, commits, blobs, and notes.
search string Yes The search term.
search_type string No The search type to use. Values include basic, advanced, and zoekt.
confidential boolean No Filter by confidentiality. Supports issues and work_items scopes; other scopes are ignored.
exclude_forks boolean No Excludes forked projects from the search. Available for exact code search. If not set, forks will be excluded. Introduced in GitLab 18.7.
regex boolean No Uses regular expressions to search for code. Available for exact code search. If not set, regular expressions are used. Introduced in GitLab 18.9.
fields array of strings No Array of fields you wish to search, allowed values are title only. Supports only issues and merge_requests scopes. Premium and Ultimate only.
include_archived boolean No Includes archived projects in the search. Default is false. Introduced in GitLab 18.7.
num_context_lines integer No Number of context lines to include around each match in the results. Available for advanced and exact code search only. Introduced in GitLab 18.11.
state string No Filter by state. Supports issues, work_items, and merge_requests scopes; other scopes are ignored.
type array of strings No Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.
order_by string No Allowed values are created_at and title. You can sort by title for the issues, work_items, and merge_requests scopes with basic search, and for the issues and work_items scopes with advanced search. Until the advanced search backfill for title sorting has finished, advanced search answers order_by=title with results sorted by created_at in descending order. Introduced in GitLab 19.5. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
sort string No Allowed values are asc or desc only. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
author_username string No Filter by author username. A username that matches no user is ignored. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
label_name array of strings No Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[author_username] string No Exclude results authored by this username. Combining a filter with its own negation matches either condition, which widens the result set. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[source_branch] string No Exclude merge requests with this source branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[target_branch] string No Exclude merge requests with this target branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
source_branch string No Filter merge requests by source branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
target_branch string No Filter merge requests by target branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.

Scope: projects

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=projects&search=flight"

Example response:

json
[
  {
    "id": 6,
    "description": "Nobis sed ipsam vero quod cupiditate veritatis hic.",
    "name": "Flight",
    "name_with_namespace": "Twitter / Flight",
    "path": "flight",
    "path_with_namespace": "twitter/flight",
    "created_at": "2017-09-05T07:58:01.621Z",
    "default_branch": "main",
    "tag_list":[], //deprecated, use `topics` instead
    "topics":[],
    "ssh_url_to_repo": "ssh://jarka@localhost:2222/twitter/flight.git",
    "http_url_to_repo": "http://localhost:3000/twitter/flight.git",
    "web_url": "http://localhost:3000/twitter/flight",
    "readme_url": "http://localhost:3000/twitter/flight/-/blob/main/README.md",
    "avatar_url": null,
    "star_count": 0,
    "forks_count": 0,
    "last_activity_at": "2018-01-31T09:56:30.902Z"
  }
]

Scope: groups

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=groups&search=flight"

Example response:

json
[
  {
    "id": 3,
    "web_url": "http://localhost:3000/groups/flightjs",
    "name": "Flightjs"
  }
]

Scope: issues

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=issues&search=file"

Example response:

json
[
  {
    "id": 83,
    "iid": 1,
    "project_id": 12,
    "title": "Add file",
    "description": "Add first file",
    "state": "opened",
    "created_at": "2018-01-24T06:02:15.514Z",
    "updated_at": "2018-02-06T12:36:23.263Z",
    "closed_at": null,
    "labels":[],
    "milestone": null,
    "assignees": [{
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    },
    "user_notes_count": 0,
    "upvotes": 0,
    "downvotes": 0,
    "due_date": null,
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/h5bp/7bp/subgroup-prj/issues/1",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

The assignee column is deprecated. It is shown as a single-sized array assignees to conform to the GitLab EE API.

Scope: work_items

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=work_items&search=migrate"

Example response:

json
[
  {
    "id": 142,
    "iid": 9,
    "project_id": 12,
    "title": "Migrate to new database",
    "description": "Database migration task",
    "state": "opened",
    "created_at": "2018-03-15T08:12:31.489Z",
    "updated_at": "2018-03-20T14:22:18.371Z",
    "closed_at": null,
    "labels": ["backend"],
    "milestone": null,
    "assignees": [{
      "id": 25,
      "name": "John Doe",
      "username": "john.doe",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/a1b2c3d4e5f6g7h8i9j0?s=80&d=identicon",
      "web_url": "http://localhost:3000/john.doe"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "type": "TASK",
    "user_notes_count": 2,
    "upvotes": 1,
    "downvotes": 0,
    "due_date": "2018-04-01",
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/my-group/my-project/-/work_items/9",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

You can filter work items by type using the type parameter:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=work_items&search=backend&type[]=task&type[]=issue"

Scope: merge_requests

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=merge_requests&search=file"

Example response:

json
[
  {
    "id": 56,
    "iid": 8,
    "project_id": 6,
    "title": "Add first file",
    "description": "This is a test MR to add file",
    "state": "opened",
    "created_at": "2018-01-22T14:21:50.830Z",
    "updated_at": "2018-02-06T12:40:33.295Z",
    "target_branch": "main",
    "source_branch": "jaja-test",
    "upvotes": 0,
    "downvotes": 0,
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 5,
      "name": "Jacquelyn Kutch",
      "username": "abigail",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/3138c66095ee4bd11a508c2f7f7772da?s=80&d=identicon",
      "web_url": "http://localhost:3000/abigail"
    },
    "source_project_id": 6,
    "target_project_id": 6,
    "labels": [
      "ruby",
      "tests"
    ],
    "draft": false,
    "work_in_progress": false,
    "milestone": {
      "id": 13,
      "iid": 3,
      "project_id": 6,
      "title": "v2.0",
      "description": "Qui aut qui eos dolor beatae itaque tempore molestiae.",
      "state": "active",
      "created_at": "2017-09-05T07:58:29.099Z",
      "updated_at": "2017-09-05T07:58:29.099Z",
      "due_date": null,
      "start_date": null
    },
    "merge_when_pipeline_succeeds": false,
    "merge_status": "can_be_merged",
    "sha": "78765a2d5e0a43585945c58e61ba2f822e4d090b",
    "merge_commit_sha": null,
    "squash_commit_sha": null,
    "user_notes_count": 0,
    "discussion_locked": null,
    "should_remove_source_branch": null,
    "force_remove_source_branch": true,
    "web_url": "http://localhost:3000/twitter/flight/merge_requests/8",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

Scope: milestones

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=milestones&search=release"

Example response:

json
[
  {
    "id": 44,
    "iid": 1,
    "project_id": 12,
    "title": "next release",
    "description": "Next release milestone",
    "state": "active",
    "created_at": "2018-02-06T12:43:39.271Z",
    "updated_at": "2018-02-06T12:44:01.298Z",
    "due_date": "2018-04-18",
    "start_date": "2018-02-04"
  }
]

Scope: snippet_titles

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=snippet_titles&search=sample"

Example response:

json
[
  {
    "id": 50,
    "title": "Sample file",
    "file_name": "file.rb",
    "description": "Simple ruby file",
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "updated_at": "2018-02-06T12:49:29.104Z",
    "created_at": "2017-11-28T08:20:18.071Z",
    "project_id": 9,
    "web_url": "http://localhost:3000/root/jira-test/snippets/50"
  }
]

Scope: users

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=users&search=doe"

Example response:

json
[
  {
    "id": 1,
    "name": "John Doe1",
    "username": "user1",
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
    "web_url": "http://localhost/user1"
  }
]

Scope: wiki_blobs

  • Tier: Premium, Ultimate

Use this scope to search wikis.

This scope is available only when advanced search is enabled.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=wiki_blobs&search=bye"

Example response:

json

[
  {
    "basename": "home",
    "data": "hello\n\nand bye\n\nend",
    "path": "home.md",
    "filename": "home.md",
    "id": null,
    "ref": "main",
    "startline": 5,
    "project_id": 6,
    "group_id": null
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521.

Scope: commits

  • Tier: Premium, Ultimate

This scope is available only when advanced search is enabled.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=commits&search=bye"

Example response:

json

[
  {
  "id": "4109c2d872d5fdb1ed057400d103766aaea97f98",
  "short_id": "4109c2d8",
  "title": "goodbye $.browser",
  "created_at": "2013-02-18T22:02:54.000Z",
  "parent_ids": [
    "59d05353ab575bcc2aa958fe1782e93297de64c9"
  ],
  "message": "goodbye $.browser\n",
  "author_name": "angus croll",
  "author_email": "anguscroll@gmail.com",
  "authored_date": "2013-02-18T22:02:54.000Z",
  "committer_name": "angus croll",
  "committer_email": "anguscroll@gmail.com",
  "committed_date": "2013-02-18T22:02:54.000Z",
  "project_id": 6
  }
]

Scope: blobs

  • Tier: Premium, Ultimate

Use this scope to search code.

This scope is available only when advanced search or exact code search is enabled.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=blobs&search=installation"

Example response:

json

[
  {
    "basename": "README",
    "data": "```\n\n## Installation\n\nQuick start using the [pre-built",
    "path": "README.md",
    "filename": "README.md",
    "id": null,
    "ref": "main",
    "startline": 46,
    "project_id": 6
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521. Elasticsearch syntax might not work properly with exact code search. Replace Elasticsearch wildcard queries with regular expressions for exact code search. For more information, see issue 521686.

Scope: notes

  • Tier: Premium, Ultimate

This scope is available only when advanced search is enabled.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/search?scope=notes&search=maxime"

Example response:

json
[
  {
    "id": 191,
    "body": "Harum maxime consequuntur et et deleniti assumenda facilis.",
    "attachment": null,
    "author": {
      "id": 23,
      "name": "User 1",
      "username": "user1",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/111d68d06e2d317b5a59c2c6c5bad808?s=80&d=identicon",
      "web_url": "http://localhost:3000/user1"
    },
    "created_at": "2017-09-05T08:01:32.068Z",
    "updated_at": "2017-09-05T08:01:32.068Z",
    "system": false,
    "noteable_id": 22,
    "noteable_type": "Issue",
    "project_id": 6,
    "noteable_iid": 2
  }
]

Search a group

Search for a term in the specified group.

If a user is not a member of a group and the group is private, a GET request on that group results in a 404 Not Found status code.

GET /groups/:id/search
Attribute Type Required Description
id integer or string Yes The ID or URL-encoded path of the group.
scope string Yes The scope to search in. Values include projects, groups, issues, work_items, merge_requests, milestones, and users. Additional scopes are wiki_blobs, commits, blobs, and notes.
search string Yes The search term.
search_type string No The search type to use. Values include basic, advanced, and zoekt.
confidential boolean No Filter by confidentiality. Supports issues and work_items scopes; other scopes are ignored.
exclude_forks boolean No Excludes forked projects from the search. Available for exact code search. If not set, forks will be excluded. Introduced in GitLab 18.7.
regex boolean No Uses regular expressions to search for code. Available for exact code search. If not set, regular expressions are used. Introduced in GitLab 18.9.
fields array of strings No Array of fields you wish to search, allowed values are title only. Supports only issues and merge_requests scopes. Premium and Ultimate only.
include_archived boolean No Includes archived projects in the search. Default is false. Introduced in GitLab 18.7.
num_context_lines integer No Number of context lines to include around each match in the results. Available for advanced and exact code search only. Introduced in GitLab 18.11.
state string No Filter by state. Supports issues, work_items, and merge_requests scopes; other scopes are ignored.
type array of strings No Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.
order_by string No Allowed values are created_at and title. You can sort by title for the issues, work_items, and merge_requests scopes with basic search, and for the issues and work_items scopes with advanced search. Until the advanced search backfill for title sorting has finished, advanced search answers order_by=title with results sorted by created_at in descending order. Introduced in GitLab 19.5. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
sort string No Allowed values are asc or desc only. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
author_username string No Filter by author username. A username that matches no user is ignored. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
label_name array of strings No Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[author_username] string No Exclude results authored by this username. Combining a filter with its own negation matches either condition, which widens the result set. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[source_branch] string No Exclude merge requests with this source branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[target_branch] string No Exclude merge requests with this target branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
source_branch string No Filter merge requests by source branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
target_branch string No Filter merge requests by target branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.

The response depends on the requested scope.

Scope: projects

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=projects&search=flight"

Example response:

json
[
  {
    "id": 6,
    "description": "Nobis sed ipsam vero quod cupiditate veritatis hic.",
    "name": "Flight",
    "name_with_namespace": "Twitter / Flight",
    "path": "flight",
    "path_with_namespace": "twitter/flight",
    "created_at": "2017-09-05T07:58:01.621Z",
    "default_branch": "main",
    "tag_list":[], //deprecated, use `topics` instead
    "topics":[],
    "ssh_url_to_repo": "ssh://jarka@localhost:2222/twitter/flight.git",
    "http_url_to_repo": "http://localhost:3000/twitter/flight.git",
    "web_url": "http://localhost:3000/twitter/flight",
    "readme_url": "http://localhost:3000/twitter/flight/-/blob/main/README.md",
    "avatar_url": null,
    "star_count": 0,
    "forks_count": 0,
    "last_activity_at": "2018-01-31T09:56:30.902Z"
  }
]

Scope: groups

This scope returns the subgroups of the specified group, not the group itself.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=groups&search=flight"

Example response:

json
[
  {
    "id": 8,
    "web_url": "http://localhost:3000/groups/flightjs/flight-crew",
    "name": "Flight Crew"
  }
]

Scope: issues

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=issues&search=file"

Example response:

json
[
  {
    "id": 83,
    "iid": 1,
    "project_id": 12,
    "title": "Add file",
    "description": "Add first file",
    "state": "opened",
    "created_at": "2018-01-24T06:02:15.514Z",
    "updated_at": "2018-02-06T12:36:23.263Z",
    "closed_at": null,
    "labels":[],
    "milestone": null,
    "assignees": [{
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    },
    "user_notes_count": 0,
    "upvotes": 0,
    "downvotes": 0,
    "due_date": null,
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/h5bp/7bp/subgroup-prj/issues/1",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

The assignee column is deprecated. It is now a single-sized assignees array.

Scope: work_items

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=work_items&search=migrate"

Example response:

json
[
  {
    "id": 142,
    "iid": 9,
    "project_id": 12,
    "title": "Migrate to new database",
    "description": "Database migration task",
    "state": "opened",
    "created_at": "2018-03-15T08:12:31.489Z",
    "updated_at": "2018-03-20T14:22:18.371Z",
    "closed_at": null,
    "labels": ["backend"],
    "milestone": null,
    "assignees": [{
      "id": 25,
      "name": "John Doe",
      "username": "john.doe",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/a1b2c3d4e5f6g7h8i9j0?s=80&d=identicon",
      "web_url": "http://localhost:3000/john.doe"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "type": "TASK",
    "user_notes_count": 2,
    "upvotes": 1,
    "downvotes": 0,
    "due_date": "2018-04-01",
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/my-group/my-project/-/work_items/9",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

You can filter work items by type using the type parameter:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=work_items&search=backend&type[]=task&type[]=issue"

Scope: merge_requests

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=merge_requests&search=file"

Example response:

json
[
  {
    "id": 56,
    "iid": 8,
    "project_id": 6,
    "title": "Add first file",
    "description": "This is a test MR to add file",
    "state": "opened",
    "created_at": "2018-01-22T14:21:50.830Z",
    "updated_at": "2018-02-06T12:40:33.295Z",
    "target_branch": "main",
    "source_branch": "jaja-test",
    "upvotes": 0,
    "downvotes": 0,
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 5,
      "name": "Jacquelyn Kutch",
      "username": "abigail",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/3138c66095ee4bd11a508c2f7f7772da?s=80&d=identicon",
      "web_url": "http://localhost:3000/abigail"
    },
    "source_project_id": 6,
    "target_project_id": 6,
    "labels": [
      "ruby",
      "tests"
    ],
    "draft": false,
    "work_in_progress": false,
    "milestone": {
      "id": 13,
      "iid": 3,
      "project_id": 6,
      "title": "v2.0",
      "description": "Qui aut qui eos dolor beatae itaque tempore molestiae.",
      "state": "active",
      "created_at": "2017-09-05T07:58:29.099Z",
      "updated_at": "2017-09-05T07:58:29.099Z",
      "due_date": null,
      "start_date": null
    },
    "merge_when_pipeline_succeeds": false,
    "merge_status": "can_be_merged",
    "sha": "78765a2d5e0a43585945c58e61ba2f822e4d090b",
    "merge_commit_sha": null,
    "squash_commit_sha": null,
    "user_notes_count": 0,
    "discussion_locked": null,
    "should_remove_source_branch": null,
    "force_remove_source_branch": true,
    "web_url": "http://localhost:3000/twitter/flight/merge_requests/8",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

Scope: milestones

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=milestones&search=release"

Example response:

json
[
  {
    "id": 44,
    "iid": 1,
    "project_id": 12,
    "title": "next release",
    "description": "Next release milestone",
    "state": "active",
    "created_at": "2018-02-06T12:43:39.271Z",
    "updated_at": "2018-02-06T12:44:01.298Z",
    "due_date": "2018-04-18",
    "start_date": "2018-02-04"
  }
]

Scope: users

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/search?scope=users&search=doe"

Example response:

json
[
  {
    "id": 1,
    "name": "John Doe1",
    "username": "user1",
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
    "web_url": "http://localhost/user1"
  }
]

Scope: wiki_blobs

  • Tier: Premium, Ultimate

Use this scope to search wikis.

This scope is available only when advanced search is enabled.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/6/search?scope=wiki_blobs&search=bye"

Example response:

json

[
  {
    "basename": "home",
    "data": "hello\n\nand bye\n\nend",
    "path": "home.md",
    "filename": "home.md",
    "id": null,
    "ref": "main",
    "startline": 5,
    "project_id": 6,
    "group_id": 1
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521.

Scope: commits

  • Tier: Premium, Ultimate

This scope is available only when advanced search is enabled.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/6/search?scope=commits&search=bye"

Example response:

json

[
  {
  "id": "4109c2d872d5fdb1ed057400d103766aaea97f98",
  "short_id": "4109c2d8",
  "title": "goodbye $.browser",
  "created_at": "2013-02-18T22:02:54.000Z",
  "parent_ids": [
    "59d05353ab575bcc2aa958fe1782e93297de64c9"
  ],
  "message": "goodbye $.browser\n",
  "author_name": "angus croll",
  "author_email": "anguscroll@gmail.com",
  "authored_date": "2013-02-18T22:02:54.000Z",
  "committer_name": "angus croll",
  "committer_email": "anguscroll@gmail.com",
  "committed_date": "2013-02-18T22:02:54.000Z",
  "project_id": 6
  }
]

Scope: blobs

  • Tier: Premium, Ultimate

Use this scope to search code.

This scope is available only when advanced search or exact code search is enabled.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/6/search?scope=blobs&search=installation"

Example response:

json

[
  {
    "basename": "README",
    "data": "```\n\n## Installation\n\nQuick start using the [pre-built",
    "path": "README.md",
    "filename": "README.md",
    "id": null,
    "ref": "main",
    "startline": 46,
    "project_id": 6
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521. Elasticsearch syntax might not work properly with exact code search. Replace Elasticsearch wildcard queries with regular expressions for exact code search. For more information, see issue 521686.

Scope: notes

  • Tier: Premium, Ultimate

This scope is available only when advanced search is enabled.

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/6/search?scope=notes&search=maxime"

Example response:

json
[
  {
    "id": 191,
    "body": "Harum maxime consequuntur et et deleniti assumenda facilis.",
    "attachment": null,
    "author": {
      "id": 23,
      "name": "User 1",
      "username": "user1",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/111d68d06e2d317b5a59c2c6c5bad808?s=80&d=identicon",
      "web_url": "http://localhost:3000/user1"
    },
    "created_at": "2017-09-05T08:01:32.068Z",
    "updated_at": "2017-09-05T08:01:32.068Z",
    "system": false,
    "noteable_id": 22,
    "noteable_type": "Issue",
    "project_id": 6,
    "noteable_iid": 2
  }
]

Search a project

Search for a term in the specified project.

If a user is not a member of a project and the project is private, a GET request on that project results in a 404 status code.

GET /projects/:id/search
Attribute Type Required Description
id integer or string Yes The ID or URL-encoded path of the project.
scope string Yes The scope to search in. Values include issues, work_items, merge_requests, milestones, and users. Additional scopes are wiki_blobs, commits, blobs, and notes.
search string Yes The search term.
search_type string No The search type to use. Values include basic, advanced, and zoekt.
confidential boolean No Filter by confidentiality. Supports issues and work_items scopes; other scopes are ignored.
regex boolean No Uses regular expressions to search for code. Available for exact code search. If not set, regular expressions are used. Introduced in GitLab 18.9.
fields array of strings No Array of fields you wish to search, allowed values are title only. Supports only issues and merge_requests scopes. Premium and Ultimate only.
num_context_lines integer No Number of context lines to include around each match in the results. Available for advanced and exact code search only. Introduced in GitLab 18.11.
ref string No The name of a repository branch or tag to search on. The project’s default branch is used by default. Applicable only for scopes blobs, commits, and wiki_blobs.
state string No Filter by state. Supports issues, work_items, and merge_requests scopes; other scopes are ignored.
type array of strings No Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.
order_by string No Allowed values are created_at and title. You can sort by title for the issues, work_items, and merge_requests scopes with basic search, and for the issues and work_items scopes with advanced search. Until the advanced search backfill for title sorting has finished, advanced search answers order_by=title with results sorted by created_at in descending order. Introduced in GitLab 19.5. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
sort string No Allowed values are asc or desc only. If not set, results are sorted by created_at in descending order for basic search, or by the most relevant documents for advanced search.
author_username string No Filter by author username. A username that matches no user is ignored. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
label_name array of strings No Filter by label name. A result must carry every name that resolves to an existing label; names that match no label are ignored. Maximum 30 names. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[author_username] string No Exclude results authored by this username. Combining a filter with its own negation matches either condition, which widens the result set. Supports the issues, merge_requests, and work_items scopes with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[source_branch] string No Exclude merge requests with this source branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
not[target_branch] string No Exclude merge requests with this target branch. Combining a filter with its own negation matches either condition, which widens the result set. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
source_branch string No Filter merge requests by source branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.
target_branch string No Filter merge requests by target branch. Supports only the merge_requests scope with advanced search. Premium and Ultimate only. Introduced in GitLab 19.5.

The response depends on the requested scope.

Scope: issues

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/12/search?scope=issues&search=file"

Example response:

json
[
  {
    "id": 83,
    "iid": 1,
    "project_id": 12,
    "title": "Add file",
    "description": "Add first file",
    "state": "opened",
    "created_at": "2018-01-24T06:02:15.514Z",
    "updated_at": "2018-02-06T12:36:23.263Z",
    "closed_at": null,
    "labels":[],
    "milestone": null,
    "assignees": [{
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 20,
      "name": "Ceola Deckow",
      "username": "sammy.collier",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/c23d85a4f50e0ea76ab739156c639231?s=80&d=identicon",
      "web_url": "http://localhost:3000/sammy.collier"
    },
    "user_notes_count": 0,
    "upvotes": 0,
    "downvotes": 0,
    "due_date": null,
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/h5bp/7bp/subgroup-prj/issues/1",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

The assignee column is deprecated. It is now a single-sized assignees array.

Scope: work_items

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/12/search?scope=work_items&search=migrate"

Example response:

json
[
  {
    "id": 142,
    "iid": 9,
    "project_id": 12,
    "title": "Migrate to new database",
    "description": "Database migration task",
    "state": "opened",
    "created_at": "2018-03-15T08:12:31.489Z",
    "updated_at": "2018-03-20T14:22:18.371Z",
    "closed_at": null,
    "labels": ["backend"],
    "milestone": null,
    "assignees": [{
      "id": 25,
      "name": "John Doe",
      "username": "john.doe",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/a1b2c3d4e5f6g7h8i9j0?s=80&d=identicon",
      "web_url": "http://localhost:3000/john.doe"
    }],
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "type": "TASK",
    "user_notes_count": 2,
    "upvotes": 1,
    "downvotes": 0,
    "due_date": "2018-04-01",
    "confidential": false,
    "discussion_locked": null,
    "web_url": "http://localhost:3000/my-group/my-project/-/work_items/9",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

You can filter work items by type using the type parameter:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/12/search?scope=work_items&search=backend&type[]=task&type[]=issue"

Scope: merge_requests

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=merge_requests&search=file"

Example response:

json
[
  {
    "id": 56,
    "iid": 8,
    "project_id": 6,
    "title": "Add first file",
    "description": "This is a test MR to add file",
    "state": "opened",
    "created_at": "2018-01-22T14:21:50.830Z",
    "updated_at": "2018-02-06T12:40:33.295Z",
    "target_branch": "main",
    "source_branch": "jaja-test",
    "upvotes": 0,
    "downvotes": 0,
    "author": {
      "id": 1,
      "name": "Administrator",
      "username": "root",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
      "web_url": "http://localhost:3000/root"
    },
    "assignee": {
      "id": 5,
      "name": "Jacquelyn Kutch",
      "username": "abigail",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/3138c66095ee4bd11a508c2f7f7772da?s=80&d=identicon",
      "web_url": "http://localhost:3000/abigail"
    },
    "source_project_id": 6,
    "target_project_id": 6,
    "labels": [
      "ruby",
      "tests"
    ],
    "draft": false,
    "work_in_progress": false,
    "milestone": {
      "id": 13,
      "iid": 3,
      "project_id": 6,
      "title": "v2.0",
      "description": "Qui aut qui eos dolor beatae itaque tempore molestiae.",
      "state": "active",
      "created_at": "2017-09-05T07:58:29.099Z",
      "updated_at": "2017-09-05T07:58:29.099Z",
      "due_date": null,
      "start_date": null
    },
    "merge_when_pipeline_succeeds": false,
    "merge_status": "can_be_merged",
    "sha": "78765a2d5e0a43585945c58e61ba2f822e4d090b",
    "merge_commit_sha": null,
    "squash_commit_sha": null,
    "user_notes_count": 0,
    "discussion_locked": null,
    "should_remove_source_branch": null,
    "force_remove_source_branch": true,
    "web_url": "http://localhost:3000/twitter/flight/merge_requests/8",
    "time_stats": {
      "time_estimate": 0,
      "total_time_spent": 0,
      "human_time_estimate": null,
      "human_total_time_spent": null
    }
  }
]

Scope: milestones

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/12/search?scope=milestones&search=release"

Example response:

json
[
  {
    "id": 44,
    "iid": 1,
    "project_id": 12,
    "title": "next release",
    "description": "Next release milestone",
    "state": "active",
    "created_at": "2018-02-06T12:43:39.271Z",
    "updated_at": "2018-02-06T12:44:01.298Z",
    "due_date": "2018-04-18",
    "start_date": "2018-02-04"
  }
]

Scope: users

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=users&search=doe"

Example response:

json
[
  {
    "id": 1,
    "name": "John Doe1",
    "username": "user1",
    "state": "active",
    "avatar_url": "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon",
    "web_url": "http://localhost/user1"
  }
]

Scope: wiki_blobs

Use this scope to search wikis.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

Wiki blobs searches are performed on both filenames and contents. Search results:

  • Found in filenames are displayed before results found in contents.
  • May contain multiple matches for the same blob because the search string might be found in both the filename and content, or might appear multiple times in the content.
shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=wiki_blobs&search=bye"

Example response:

json

[
  {
    "basename": "home",
    "data": "hello\n\nand bye\n\nend",
    "path": "home.md",
    "filename": "home.md",
    "id": null,
    "ref": "main",
    "startline": 5,
    "project_id": 6,
    "group_id": 1
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521.

Scope: commits

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=commits&search=bye"

Example response:

json

[
  {
  "id": "4109c2d872d5fdb1ed057400d103766aaea97f98",
  "short_id": "4109c2d8",
  "title": "goodbye $.browser",
  "created_at": "2013-02-18T22:02:54.000Z",
  "parent_ids": [
    "59d05353ab575bcc2aa958fe1782e93297de64c9"
  ],
  "message": "goodbye $.browser\n",
  "author_name": "angus croll",
  "author_email": "anguscroll@gmail.com",
  "authored_date": "2013-02-18T22:02:54.000Z",
  "committer_name": "angus croll",
  "committer_email": "anguscroll@gmail.com",
  "committed_date": "2013-02-18T22:02:54.000Z",
  "project_id": 6
  }
]

Scope: blobs

Use this scope to search code.

The following filters are available for this scope:

  • filename
  • path
  • extension

To use a filter, include it in your query (for example, a query filename:some_name*).

You can use wildcards (*) for glob matching.

Blobs searches are performed on both filenames and contents. Search results:

  • Found in filenames are displayed before results found in contents.
  • May contain multiple matches for the same blob because the search string might be found in both the filename and content, or might appear multiple times in the content.
shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=blobs&search=keyword%20filename:*.py"

Example response:

json

[
  {
    "basename": "README",
    "data": "```\n\n## Installation\n\nQuick start using the [pre-built",
    "path": "README.md",
    "filename": "README.md",
    "id": null,
    "ref": "main",
    "startline": 46,
    "project_id": 6
  }
]

filename is deprecated in favor of path. Both return the full path of the file inside the repository, but in the future filename is intended to be only the filename and not the full path. For details, see issue 34521. Elasticsearch syntax might not work properly with exact code search. Replace Elasticsearch wildcard queries with regular expressions for exact code search. For more information, see issue 521686.

Scope: notes

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/6/search?scope=notes&search=maxime"

Example response:

json
[
  {
    "id": 191,
    "body": "Harum maxime consequuntur et et deleniti assumenda facilis.",
    "attachment": null,
    "author": {
      "id": 23,
      "name": "User 1",
      "username": "user1",
      "state": "active",
      "avatar_url": "https://www.gravatar.com/avatar/111d68d06e2d317b5a59c2c6c5bad808?s=80&d=identicon",
      "web_url": "http://localhost:3000/user1"
    },
    "created_at": "2017-09-05T08:01:32.068Z",
    "updated_at": "2017-09-05T08:01:32.068Z",
    "system": false,
    "noteable_id": 22,
    "noteable_type": "Issue",
    "project_id": 6,
    "noteable_iid": 2
  }
]
  • Tier: Premium, Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed
  • Status: Beta

Search for code in a project based on meaning rather than keyword matching.

GET /projects/:id/search/semantic
Attribute Type Required Description
id integer or string Yes ID or URL-encoded path of the project.
q string Yes Natural language search query.
directory_path string No Directory path to scope the search to.
knn integer No Number of nearest neighbors to consider during the vector search (1-100). Default is 64.
limit integer No Maximum number of results to return (1-100). Default is 20.

Example request:

shell
curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/projects/12/search/semantic?q=authentication%20middleware"

Example response:

The response is an array of code search results. Each result contains the following fields:

Field Type Description
path string The file path relative to the repository root.
content string A snippet of the code content from the matched file.
score number The semantic similarity score between the query and the result (0-1). Higher scores indicate better matches.
language string The programming language of the file.
start_line integer The line number where the matched code snippet begins.
blob_id string The Git blob ID of the file.
file_url string The URL to view the file in GitLab.
json
[
  {
    "path": "app/services/auth/jwt_service.rb",
    "content": "def verify_token(token)\n  JWT.decode(token, secret_key)...",
    "score": 0.91,
    "language": "ruby",
    "start_line": 42,
    "blob_id": "a1b2c3d4e5f6...",
    "file_url": "https://gitlab.example.com/my-org/my-project/-/blob/main/app/services/auth/jwt_service.rb"
  }
]