Commands Quick Reference
FreshAPI Endpoint
http://api-fulfill.dataexchange.us-east-1.amazonaws.com/v1All requests are HTTP POST to this URL.
Required Headers
Every API request must include all five of these headers:
| Header | Value |
|---|---|
Content-Type | application/graphql |
x-api-key | Your API key |
x-amzn-dataexchange-data-set-id | Your data set ID |
revision-id | Your revision ID |
asset-id | Your asset ID |
Authentication Environment Variables
bash
# AWS credentials
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export AWS_DEFAULT_REGION=us-east-1
# IMDb API credentials
export IMDB_DATA_SET_ID=your-data-set-id
export IMDB_REVISION_ID=your-revision-id
export IMDB_ASSET_ID=your-asset-id
export IMDB_API_KEY=your-api-keyWindows (PowerShell):
powershell
$env:AWS_ACCESS_KEY_ID = "AKIAIOSFODNN7EXAMPLE"
$env:AWS_SECRET_ACCESS_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
$env:AWS_DEFAULT_REGION = "us-east-1"
$env:IMDB_DATA_SET_ID = "your-data-set-id"
$env:IMDB_REVISION_ID = "your-revision-id"
$env:IMDB_ASSET_ID = "your-asset-id"
$env:IMDB_API_KEY = "your-api-key"AWS CLI Command
bash
aws dataexchange send-api-asset \
--data-set-id "$IMDB_DATA_SET_ID" \
--revision-id "$IMDB_REVISION_ID" \
--asset-id "$IMDB_ASSET_ID" \
--request-headers "{\"x-api-key\":\"$IMDB_API_KEY\",\"Content-Type\":\"application/graphql\"}" \
--method "POST" \
--path "/" \
--body '{"query":"{ title(id: \"tt0068646\") { titleText { text } } }"}' \
--region us-east-1AWS Profile Setup
bash
aws configure --profile imdb-api
# Enter: Access Key ID, Secret Access Key, region (us-east-1), output format (json)
# Use the profile
export AWS_PROFILE=imdb-apiInstall Commands
TypeScript
bash
npm init -y
npm install @aws-sdk/client-dataexchange
npm install --save-dev typescript ts-node @types/nodePython
bash
pip install boto3Java (Maven)
Add to pom.xml:
xml
<dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.16.60</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>apache-client</artifactId>
</dependency>
</dependencies>Run Commands
TypeScript
bash
npx ts-node imdb_api_request.tsPython
bash
python imdb_api_request.pyJava
bash
mvn package
java -jar target/imdb-api-client-1.0-SNAPSHOT.jarRAG Setup (Documentation Chat)
After building the VitePress site, run this once to create the vector store:
bash
OPENAI_API_KEY=your-openai-key npm run setup-ragThen add the returned OPENAI_VECTOR_STORE_ID to your Vercel environment variables.
Build and Deploy
bash
# Install dependencies
npm install
# Development server
npm run dev
# Production build
npm run build
# Preview production build locally
npm run preview