- Open Postman
- Click "Import" (top left)
- Select "Link" tab
- Enter this URL:
http://192.168.0.9:8000/openapi.json - Click "Continue" → "Import"
- You should see a new collection called "Yelp"
- It will contain all API endpoints organized by categories:
- 🏢 Businesses (4 endpoints)
- 📝 Reviews (4 endpoints)
- 👥 Users (2 endpoints)
- 💡 Tips (4 endpoints)
- ✅ Checkins (3 endpoints)
- 🔧 Health (2 endpoints)
The OpenAPI specification has been saved to:
/home/steven/fastapi-yelp-postgres/yelp-api-openapi.json
- Open Postman
- Click "Import"
- Select "Upload Files"
- Choose
yelp-api-openapi.json - Click "Import"
If automatic import doesn't work, here's a pre-configured Postman collection:
{
"info": {
"name": "Yelp Data API",
"description": "FastAPI backend for querying Yelp database",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"variable": [
{
"key": "base_url",
"value": "http://192.168.0.9:8000",
"type": "string"
}
],
"item": [
{
"name": "Health Check",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/health",
"host": ["{{base_url}}"],
"path": ["health"]
}
}
},
{
"name": "Get All Businesses",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/businesses/?skip=0&limit=10",
"host": ["{{base_url}}"],
"path": ["api", "v1", "businesses", ""],
"query": [
{"key": "skip", "value": "0"},
{"key": "limit", "value": "10"}
]
}
}
},
{
"name": "Get Business by ID",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/businesses/MTSW4McQd7CbVtyjqoe9mw",
"host": ["{{base_url}}"],
"path": ["api", "v1", "businesses", "MTSW4McQd7CbVtyjqoe9mw"]
}
}
},
{
"name": "Get Businesses by City",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/businesses/city/Philadelphia?skip=0&limit=10",
"host": ["{{base_url}}"],
"path": ["api", "v1", "businesses", "city", "Philadelphia"],
"query": [
{"key": "skip", "value": "0"},
{"key": "limit", "value": "10"}
]
}
}
},
{
"name": "Get Businesses by Stars",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/businesses/stars/4.0?skip=0&limit=10",
"host": ["{{base_url}}"],
"path": ["api", "v1", "businesses", "stars", "4.0"],
"query": [
{"key": "skip", "value": "0"},
{"key": "limit", "value": "10"}
]
}
}
},
{
"name": "Get All Reviews",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/reviews/?skip=0&limit=10",
"host": ["{{base_url}}"],
"path": ["api", "v1", "reviews", ""],
"query": [
{"key": "skip", "value": "0"},
{"key": "limit", "value": "10"}
]
}
}
},
{
"name": "Get Reviews by Business",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{base_url}}/api/v1/reviews/business/MTSW4McQd7CbVtyjqoe9mw?skip=0&limit=5",
"host": ["{{base_url}}"],
"path": ["api", "v1", "reviews", "business", "MTSW4McQd7CbVtyjqoe9mw"],
"query": [
{"key": "skip", "value": "0"},
{"key": "limit", "value": "5"}
]
}
}
}
]
}- Copy the JSON above
- Open Postman → Import → Raw text
- Paste the JSON → Continue → Import
- Click the gear icon (⚙️) in top right
- Click "Add" to create new environment
- Name it: "Yelp API Local"
- Add variables:
- Variable:
base_url - Initial Value:
http://192.168.0.9:8000 - Current Value:
http://192.168.0.9:8000
- Variable:
- Click "Add" then "Close"
- Select "Yelp API Local" from environment dropdown
-
Health Check
GET {{base_url}}/health -
List Businesses
GET {{base_url}}/api/v1/businesses/?skip=0&limit=5 -
List Reviews
GET {{base_url}}/api/v1/reviews/?skip=0&limit=5 -
Business by City
GET {{base_url}}/api/v1/businesses/city/Philadelphia?limit=3 -
High-Rated Businesses
GET {{base_url}}/api/v1/businesses/stars/4.5?limit=5
- Swagger UI: http://192.168.0.9:8000/docs
- ReDoc: http://192.168.0.9:8000/redoc
- OpenAPI JSON: http://192.168.0.9:8000/openapi.json
GET /api/v1/businesses/- List all businessesGET /api/v1/businesses/{business_id}- Get specific businessGET /api/v1/businesses/city/{city}- Businesses by cityGET /api/v1/businesses/stars/{min_stars}- Businesses by rating
GET /api/v1/reviews/- List all reviewsGET /api/v1/reviews/{review_id}- Get specific reviewGET /api/v1/reviews/business/{business_id}- Reviews for businessGET /api/v1/reviews/user/{user_id}- Reviews by user
GET /api/v1/users/- List all usersGET /api/v1/users/{user_id}- Get specific user
GET /api/v1/tips/- List all tipsGET /api/v1/tips/{user_id}/{business_id}- Specific tipGET /api/v1/tips/business/{business_id}- Tips for businessGET /api/v1/tips/user/{user_id}- Tips by user
GET /api/v1/checkins/- List all checkinsGET /api/v1/checkins/{business_id}/{date}- Specific checkinGET /api/v1/checkins/business/{business_id}- Checkins for business
Your Postman collection is now set up with all the Yelp API endpoints. You can:
- ✅ Test all endpoints immediately
- ✅ Use environment variables for easy URL management
- ✅ Explore your Yelp dataset interactively
- ✅ Build custom requests for data analysis
Pro Tip: Use the skip and limit parameters to paginate through large datasets efficiently!