Skip to content
VercelLogotypeVercelLogotype
LoginSign Up

NextJS + Parallel Starter

A Next.js template demonstrating how to integrate Parallel's web research APIs with Vercel. This template provides a complete demo applicati

DeployView Demo
This is an auto-uploaded thumbnail from https://vercel.com/templates/submit.

Parallel + Vercel Template

A Next.js template demonstrating how to integrate Parallel's web research APIs with Vercel. This template provides a complete demo application showcasing the Search, Extract, and Tasks APIs with real-time SSE streaming.

View the demo at: https://parallel-vercel-template-cookbook.vercel.app/

Features

FeatureDescription
Search APINatural language web search with mode selection (one-shot vs agentic)
Extract APIContent extraction from URLs with objective-focused filtering
Tasks APIDeep research tasks with real-time SSE event streaming
Session PersistenceSearch/Extract results persist in sessionStorage, Tasks persist in localStorage
Status RecoveryAutomatically checks and updates pending task statuses on page reload

Architecture

┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ React UI │────▶│ Next.js API │────▶│ Parallel API │
│ Components │ │ Routes │ │ (parallel-web) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
│ sessionStorage │ SDK calls
│ localStorage │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ SearchDemo │ │ /api/search │ → client.beta.search()
│ ExtractDemo │ │ /api/extract │ → client.beta.extract()
│ TasksDemo │ │ /api/tasks │ → client.taskRun.create()
└─────────────────┘ │ /api/tasks/[id]/status │ → client.taskRun.retrieve()
│ /api/tasks/[id]/events │ → client.beta.taskRun.events()
└─────────────────┘

How It Works

  1. Search: User enters a search objective and optional queries → API calls client.beta.search() → Returns ranked results with excerpts
  2. Extract: User enters URLs and optional objective → API calls client.beta.extract() → Returns extracted content
  3. Tasks: User enters a research task → API calls client.taskRun.create() → SSE stream delivers real-time progress → Final output displayed on completion

Quick Start

Prerequisites

  • Node.js 18+
  • A Parallel API key (via Vercel Integration)

1. Clone and Install

cd typescript-recipes/parallel-vercel-template
npm install

2. Configure Environment

cp .env.example .env.local

Edit .env.local with your Parallel API key:

PARALLEL_API_KEY=your-api-key-here

3. Run the Development Server

npm run dev

Open http://localhost:3000 to see the demo.

Project Structure

parallel-vercel-template/
├── app/
│ ├── api/
│ │ ├── search/route.ts # Search API endpoint
│ │ ├── extract/route.ts # Extract API endpoint
│ │ └── tasks/
│ │ ├── route.ts # Create task endpoint
│ │ └── [runId]/
│ │ ├── status/route.ts # Task status polling
│ │ └── events/route.ts # SSE event streaming
│ ├── components/
│ │ ├── SearchDemo.tsx # Search UI with mode toggle
│ │ ├── ExtractDemo.tsx # Extract UI
│ │ └── TasksDemo.tsx # Tasks UI with SSE streaming
│ ├── page.tsx # Main page with tabs
│ ├── layout.tsx # App layout
│ └── globals.css # Tailwind styles
├── .env.example # Environment template
├── package.json
└── README.md

Deploying to Vercel

  1. Push to your GitHub repository
  2. Import the project in Vercel
  3. Add PARALLEL_API_KEY to Environment Variables
  4. Deploy

Using Vercel Integration

The easiest way to get an API key is through the Parallel Vercel Integration:

  1. Install the integration on your Vercel project
  2. The PARALLEL_API_KEY environment variable is automatically added
  3. Access the Parallel playground by clicking "Open in Parallel Web Systems"

Exploring More APIs

Want to try the Monitor or FindAll APIs?

Go to your Vercel Integration page, select a project, and click "Open in Parallel Web Systems" to access the full playground.

Resources

  • Parallel Documentation
  • Search API Reference
  • Extract API Reference
  • Tasks API Reference
  • SSE Streaming Guide
  • Pricing
  • parallel-web npm package
  • Vercel Integration

License

MIT

GitHub
Ownerparallel-web
Repositoryparallel-cookbook
Use Cases
AI
Stack
Next.js
Tailwind

Related Templates

Next.js Boilerplate

Get started with Next.js and React in seconds.
Next.js Boilerplate thumbnail

Image Gallery Starter

An image gallery built on Next.js and Vercel Blob.
Image Gallery Starter thumbnail

Chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel
Chatbot thumbnail

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • EveNew
  • ConnectNew

Core Platform

  • CI/CD
  • Content Delivery
  • Fluid Compute
  • Observability

Security

  • Platform Security
  • WAF
  • Bot Management
  • Bot ID

Tools

  • Vercel DropNew
  • Vercel Agent
  • Vercel PluginNew
  • Next.js
  • Domains
  • v0

Frameworks

  • Nuxt
  • SvelteKit
  • Nitro
  • Turborepo
  • Tanstack Start
  • FastAPI
  • xmcp
  • All frameworks

SDKs

  • Vercel SDK
  • Workflow SDKNew
  • Flags SDK
  • Chat SDKNew
  • Queues SDKNew
  • Streamdown

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
  • Platform Engineers
  • Design Engineers

Learn

  • Docs
  • Blog
  • Changelog
  • Knowledge Base
  • Academy
  • Articles
  • Community

Explore

  • Customers
  • Marketplace
  • Templates
  • Partner Finder
  • Vercel + AWS

Company

  • About
  • Careers
  • Press
  • Events
  • Startups
  • Shipped on Vercel
  • Open Source Program
  • Enterprise
  • Pricing
  • Help

Legal & Trust

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DPA
  • Acceptable Use Policy
  • Legal (all documents)
  • Trust Center
  • Status

Social

  • GitHub
  • X
  • LinkedIn
  • YouTube
  • Instagram
  • VercelVercel
Agent Stack
  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Eve
Core Platform
  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD
Tools
  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Learn
  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base
Build
  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce
Explore
  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
EnterprisePricing
Contact
Log InSign Up
Dashboard

Products

Agent Stack

  • AI SDK
  • AI Gateway
  • Sandbox
  • Workflows
  • Eve

Core Platform

  • Security
  • Content Delivery
  • Fluid Compute
  • Observability
  • CI/CD

Tools

  • Next.js
  • Vercel Agent
  • Vercel Plugin
  • Domains
  • v0
Resources

Learn

  • Docs
  • About
  • Blog
  • Changelog
  • Knowledge Base

Build

  • AI Apps
  • Web Apps
  • Marketing Sites
  • Platforms
  • Commerce

Explore

  • Customers
  • Marketplace
  • Partner Finder
  • AWS
  • Community
Enterprise
Pricing
Sign UpLog In
Contact
DeployView Demo

Loading status…

Select a display theme: