@outerview/sdk
The official JavaScript client for Outerview: stream
the physical world through visual observations, locations, and time. Use it
when your app needs to find things such as street trees, waterfront paths,
construction activity, or other observable conditions instead of web pages.
Install
npm install @outerview/sdk
Create an API key in the Outerview developer console and keep it on your
server. Do not expose a private API key in browser code.
import { createOuterviewClient } from "@outerview/sdk";
const outerview = createOuterviewClient({
apiKey: process.env.OUTERVIEW_API_KEY,
});
Stream the world
stream() submits a visual stream and returns GeoJSON results with location,
capture date, and public properties. limit is enforced by the API key's plan.
const result = await outerview.stream({
query: "street trees in Toronto",
position: { points: [
{ latitude: 43.6532, longitude: -79.3832 },
{ latitude: 43.6629, longitude: -79.3957 },
] },
limit: 50,
});
for (const feature of result.data.geojson.features) {
console.log(feature.properties.name, feature.geometry);
}
position is an extensible object. Its current points array contains
latitude/longitude objects. The API converts every point to an H3
resolution-5 cell and applies the cells as an h3_r5 In filter on the global
namespace; future position types such as line strings can be added to the same
object.
Stream interactive experiences
Use interactive() when your product needs only results that can be opened in
an immersive interactive viewer. This method always sends interactive: true; callers
cannot accidentally receive flat-only results.
const result = await outerview.interactive({
query: "walkable waterfront paths in Chicago",
limit: 50,
});
const captures = result.data.geojson.features;
Pair an interactive result with @outerview/sdk-360
to mount a player in a web product.
List video captures
Pro and Scale keys can retrieve video captures. The API rejects lower tiers so
that a Starter key cannot access video URLs.
const page = await outerview.sequences({
interactive: "true",
page: "1",
pageSize: "24",
});
Errors and custom environments
Failed requests throw OuterviewApiError, including the HTTP status and parsed
response body. Set baseUrl for a compatible development endpoint.
import { createOuterviewClient, OuterviewApiError } from "@outerview/sdk";
try {
await outerview.stream({ query: "bike lanes", limit: 50 });
} catch (error) {
if (error instanceof OuterviewApiError) {
console.error(error.status, error.body);
}
}
Plans and limits
Free supports 5 RPM and 5 results per request. Starter supports 500 RPM and
50 results. Pro supports 2,000 RPM and 50 results with video access. Scale
supports 8,000 RPM and 200 results with video access. See
Outerview billing for current details.