---
title: "content.get()"
description: "Fetches one document by path from the handler's get route."
canonical_url: "https://content.comark.dev/reference/client/get"
---
# content.get()

> Fetches one document by path from the handler's get route.

## `content.get(path)`

Fetches one document by path from the handler's `get` route.

Public paths are normalized to lowercase on the server. Lookup is case-insensitive, and the returned file uses the normalized lowercase path.

**Parameters:**

- `path`: public path of the document (for example `/posts/hello`). Matching is case-insensitive.

**Returns:** `Promise<`[`ContentFile`](https://content.comark.dev/reference/types/content#contentfiletdata-tmeta)`<Data> | null>`, `null` when the path doesn't resolve to a document.

```ts [usage.ts]
const page = await content.get('/posts/hello')
```

Like its [server counterpart](https://content.comark.dev/reference/content/get), the client `get()` is typed against the generated path map, so a known path literal returns that path's data type without a type argument:

```ts [typed.ts]
const page = await content.get('/posts/hello')
// page?.data: PostsData
```

Run [type generation](https://content.comark.dev/guide/typescript) to populate the registry. Without it, `data` stays an open record. You can provide an explicit type when the path isn't generated:

```ts [explicit-type.ts]
const page = await content.get<PostFrontmatter>('/posts/hello')
```


## Sitemap

See the full [sitemap](https://content.comark.dev/sitemap.md) for all pages.
