---
updatedAt: 2026-04-16T09:29:31.000Z
agentTools:
  siteIndex: https://docs.jfrog.com/llms.txt
  projectIndex: https://docs.jfrog.com/artifactory/llms.txt
---

# Artifact Latest Version Search Based on Layout

Search for the latest artifact version by groupId and artifactId, based on the definitions in the Repository Layouts.
This API is based on a Maven-specific algorithm for sorting versions.

Search can be limited to specific repositories (local, remote-cache, or virtual) by settings the `repos` parameter.

**Latest release vs. latest integration:** Unless the version parameter is specified, the search returns the latest artifact release version. When version is specified, e.g. `1.0-SNAPSHOT`, the result is the latest integration version.

**Remote searches:** By default only local and cache repositories will be used. When specifying `remote=1`, Artifactory searches for versions on remote repositories. Note that this can dramatically slow down the search.

**Filtering results (Artifactory 3.0.2+):** The `version` parameter can accept the `*` and/or `?` wildcards which will then filter the final result to match only those who match the given version pattern.

**Artifact path pattern:** The `[org]` and `[module]` fields must be specified in the artifact path pattern of the repository layout for this call to work.

**Product:** Requires Artifactory Pro

**Since:** 2.6.0

**Security:** Requires a privileged user (can be anonymous)


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "JFrog Artifactory Searches API",
    "description": "REST API for searching artifacts, builds, and other items in JFrog Artifactory using various search methods including AQL, GAVC, property search, checksum search, and more.\n\n> **Important Note on Search Result Limits**\n>\n> All searches return limited results for internal and anonymous users (same limits as in the user interface).\n> To modify the default limit results, edit the `artifactory.system.properties` file with:\n> - `artifactory.search.limitAnonymousUsersOnly=false` (default is `true`)\n> - `artifactory.search.userQueryLimit` (default is `1000`)\n>\n> This applies to the following search APIs: Artifact Search, Archive Entries Search, GAVC Search, Property Search, Checksum Search (limited by UI max results),\n> Artifacts Not Downloaded Since, Artifacts With Date in Date Range, Artifacts Created in Date Range\n",
    "version": "1.0.0",
    "contact": {
      "name": "JFrog Support"
    }
  },
  "servers": [
    {
      "url": "https://{jfrog_url}/artifactory/api",
      "description": "JFrog Platform",
      "variables": {
        "jfrog_url": {
          "default": "myserver.jfrog.io",
          "description": "Your JFrog Platform hostname (e.g., mycompany.jfrog.io)"
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Searches",
      "description": "Search operations for artifacts and builds"
    }
  ],
  "paths": {
    "/search/latestVersion": {
      "get": {
        "tags": [
          "Searches"
        ],
        "summary": "Artifact Latest Version Search Based on Layout",
        "operationId": "searchLatestVersion",
        "description": "Search for the latest artifact version by groupId and artifactId, based on the definitions in the Repository Layouts.\nThis API is based on a Maven-specific algorithm for sorting versions.\n\nSearch can be limited to specific repositories (local, remote-cache, or virtual) by settings the `repos` parameter.\n\n**Latest release vs. latest integration:** Unless the version parameter is specified, the search returns the latest artifact release version. When version is specified, e.g. `1.0-SNAPSHOT`, the result is the latest integration version.\n\n**Remote searches:** By default only local and cache repositories will be used. When specifying `remote=1`, Artifactory searches for versions on remote repositories. Note that this can dramatically slow down the search.\n\n**Filtering results (Artifactory 3.0.2+):** The `version` parameter can accept the `*` and/or `?` wildcards which will then filter the final result to match only those who match the given version pattern.\n\n**Artifact path pattern:** The `[org]` and `[module]` fields must be specified in the artifact path pattern of the repository layout for this call to work.\n\n**Product:** Requires Artifactory Pro\n\n**Since:** 2.6.0\n\n**Security:** Requires a privileged user (can be anonymous)\n",
        "parameters": [
          {
            "name": "g",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "GroupId"
          },
          {
            "name": "a",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ArtifactId"
          },
          {
            "name": "v",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Version pattern (supports wildcards `*` and `?`)"
          },
          {
            "name": "remote",
            "in": "query",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ],
              "default": 0
            },
            "description": "When specifying `remote=1`, Artifactory searches for versions on remote repositories."
          },
          {
            "$ref": "#/components/parameters/Repos"
          }
        ],
        "responses": {
          "200": {
            "description": "Returns the latest version string as plain text.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string",
                  "description": "Latest version string"
                },
                "examples": {
                  "latestVersionResult": {
                    "summary": "Latest version result",
                    "value": "1.0-201203131455-2"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    }
  },
  "security": [
    {
      "BasicAuth": []
    },
    {
      "ApiKeyAuth": []
    },
    {
      "BearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic",
        "description": "Username and password or username and API key."
      },
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-JFrog-Art-Api",
        "description": "JFrog API key passed in the `X-JFrog-Art-Api` header."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Access token obtained from JFrog Platform."
      }
    },
    "parameters": {
      "Repos": {
        "name": "repos",
        "in": "query",
        "schema": {
          "type": "string"
        },
        "description": "Comma-separated list of repository keys to limit search to"
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is invalid. Check the error message for details.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "errors": [
                {
                  "status": 400,
                  "message": "Missing required parameters or invalid query."
                }
              ]
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication credentials are missing or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "errors": [
                {
                  "status": 401,
                  "message": "Bad credentials"
                }
              ]
            }
          }
        }
      },
      "Forbidden": {
        "description": "The authenticated user does not have the required permissions.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "errors": [
                {
                  "status": 403,
                  "message": "User is not an admin"
                }
              ]
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected server error occurred. If this persists, contact [JFrog Support](https://jfrog.com/help).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "errors": [
                {
                  "status": 500,
                  "message": "An unexpected error occurred"
                }
              ]
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "description": "Standard JFrog Platform error response envelope.",
        "required": [
          "errors"
        ],
        "properties": {
          "errors": {
            "type": "array",
            "description": "One or more error details.",
            "items": {
              "$ref": "#/components/schemas/ErrorDetail"
            }
          }
        },
        "example": {
          "errors": [
            {
              "status": 400,
              "message": "Invalid request"
            }
          ]
        }
      },
      "ErrorDetail": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "status": {
            "type": "integer",
            "description": "HTTP status code.",
            "example": 400
          },
          "message": {
            "type": "string",
            "description": "Human-readable error description.",
            "minLength": 1,
            "example": "Invalid request"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false
  }
}
```