search
projects

Search a project

Searches for content in a specified project.

get/api/v4/projects/{id}/(-/)search

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Query parameters

searchstring required

The expression it should be searched for

scope'issues' | 'work_items' | 'merge_requests' | 'milestones' | 'notes' | 'wiki_blobs' | 'commits' | 'blobs' | 'users' required

The scope of the search

refstring

The name of a repository branch or tag. If not given, the default branch is used

state'all' | 'opened' | 'closed' | 'merged'

Filter results by state

confidentialboolean

Filter results by confidentiality

typestring[]

Filter work items by type. Only applies to work_items scope. Available types: issue, task, epic, incident, test_case, requirement, objective, key_result, ticket.

fieldsstring[]

Array of fields you wish to search. Available with advanced search.

num_context_linesinteger

Number of context lines around each match. Available with advanced and exact code search. Introduced in GitLab 18.11.

regexboolean

Performs a regex code search. Available with exact code search. Introduced in GitLab 18.9

pageinteger

Current page number

per_pageinteger

Number of items per page

Response

Search a project

Changes

No recorded changes to this operation across all 5 revisions of this API.