Skip to content

Upstash Keys

Setting Up Upstash Search for Your Astro Project

Section titled “Setting Up Upstash Search for Your Astro Project”

This guide walks you through creating an Upstash Search database and retrieving your API credentials:
UPSTASH_SEARCH_REST_URL and UPSTASH_SEARCH_REST_TOKEN.


Upstash Search is a fully managed, serverless search database built on Redis.
It’s perfect for fast, cost-efficient full-text search in static or serverless environments like Astro Actions.


  1. Go to https://upstash.com
  2. Sign up using GitHub, Google, or email.
  3. Once logged in, click “Create Database”“Search”.

###Step 2: Create a Search Database

  1. Choose Search as the database type.
  2. Give your database a name (e.g., my-search).
  3. Pick a region close to your users (e.g., eu-west-1 for Europe).
  4. Click “Create Database”.

Upstash will automatically provision your search database within a few seconds.


After the database is created:

  1. Open the database dashboard.
  2. Find the “REST API” section.
  3. Copy the following values:
    • REST URLUPSTASH_SEARCH_REST_URL
    • REST TokenUPSTASH_SEARCH_REST_TOKEN

Example:

Terminal window
UPSTASH_SEARCH_REST_URL=https://your-search-name-eu1.upstash.io
UPSTASH_SEARCH_REST_TOKEN=AYJZZasvNjY6MjM3MzYtYWI2My00ZTNhLTlkNmEtODJmNTA1NzJmZGE4YjNkZTRlNGRmYzA=

In your Astro project root, create a .env file (if you don’t already have one):

Terminal window
touch .env

Add your credentials:

Terminal window
UPSTASH_SEARCH_REST_URL="https://your-search-name.upstash.io"
UPSTASH_SEARCH_REST_TOKEN="your-secret-token"

👉 Check the official docs for advanced usage:
https://upstash.com/docs/search