<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/database](./database.md) &gt; [Query](./database.query.md) &gt; [toString](./database.query.tostring.md)

## Query.toString() method

Gets the absolute URL for this location.

The `toString()` method returns a URL that is ready to be put into a browser, curl command, or a `refFromURL()` call. Since all of those expect the URL to be url-encoded, `toString()` returns an encoded URL.

Append '.json' to the returned URL when typed into a browser to download JSON-formatted data. If the location is secured (that is, not publicly readable), you will get a permission-denied error.

<b>Signature:</b>

```typescript
toString(): string;
```
<b>Returns:</b>

string

The absolute URL for this location.

