<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [motion-sdk](./motion-sdk.md) &gt; [Motion](./motion-sdk.motion.md) &gt; [unsafe\_fetch](./motion-sdk.motion.unsafe_fetch.md)

## Motion.unsafe\_fetch() method

Low-level interface to the Motion API.

**Signature:**

```typescript
unsafe_fetch(input: string | URL | globalThis.Request, init?: RequestInit): Promise<Response | UnsafeFetchError>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

input


</td><td>

string \| URL \| globalThis.Request


</td><td>

URL or Request object.


</td></tr>
<tr><td>

init


</td><td>

RequestInit


</td><td>

_(Optional)_ Request parameters.


</td></tr>
</tbody></table>
**Returns:**

Promise&lt;Response \| [UnsafeFetchError](./motion-sdk.unsafefetcherror.md)<!-- -->&gt;

[Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) or an [UnsafeFetchError](./motion-sdk.unsafefetcherror.md)

## Remarks

This function makes a call to the Motion API. The request and return values are the same as the platform [fetch()](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)<!-- -->, except some logic is added for authentication and session management. If a string is passed as the request URL, the API's base URL will be prepended.

`unsafe_fetch` does not respect rate limiting or anything else about the client's state. It can be called and will happily make requests to the Motion API even if the limit is already exceeded and even if [close](./motion-sdk.motion.close.md) has been called. It will \_not\_ update the internal rate limiter, even if Motion reports a rate limit overrun.

Normally this function should be called only from [Motion.fetch()](./motion-sdk.motion.fetch.md)<!-- -->, but it is exposed to accommodate performance optimizations by advanced users. Use at your own peril.

