---
title: "Get the navigation tree"
description: "Returns the navigation groups and their links. The `href` value is relative to your site URL, and the `url` value is absolute. A link with nested pages also has a `children` array of links."
url: https://beacon-arodoni.vercel.app/api-reference/get-nav
---

# Get the navigation tree

`GET /nav.json`

Base URL: `https://example.com/api/v1`

Returns the navigation groups and their links. The `href` value is relative to your site URL, and the `url` value is absolute. A link with nested pages also has a `children` array of links.

## Responses

### 200

Navigation groups and their links

Content type: `application/json`

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| groups | array<object> | Yes |  |
| groups.title | string | Yes |  |
| groups.href | string | Yes |  |
| groups.url | string (uri) | Yes |  |
| groups.items | array<object> | Yes |  |
| groups.items.title | string | Yes |  |
| groups.items.href | string | Yes |  |
| groups.items.url | string (uri) | Yes |  |
| groups.items.children | array<NavLink> | No |  |

```json
{
  "groups": [
    {
      "title": "Get Started",
      "href": "/",
      "url": "https://example.com/",
      "items": [
        {
          "title": "Quickstart",
          "href": "/quickstart",
          "url": "https://example.com/quickstart",
          "children": [
            {}
          ]
        }
      ]
    }
  ]
}
```

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://example.com/api/v1/nav.json'
```

### JavaScript

```javascript
const response = await fetch("https://example.com/api/v1/nav.json", {
  method: "GET",
});

console.log(await response.json());
```

### Python

```python
import requests

response = requests.request(
    "GET",
    "https://example.com/api/v1/nav.json",
)

print(response.json())
```
