Show reviews on each employee’s page
Customers often name the person who helped them: “Ask for John at the Seattle office”, “Mary Ann sorted my claim in a day”. With GET /v1/reviews you can find those reviews per office and show them on each employee’s profile page, next to their photo and contact details. This page shows the call, a small server route that keeps your API key private, and the HTML and JavaScript that draw the reviews.
It works the same for one office or for hundreds, and on every platform you connect (Google, Yelp, Trustpilot, the App Store…). The search only reads the reviews Prisma already stored, so it costs nothing extra and uses no paid reads.
1. Find the office’s location ID
Each office on each platform is a location. List them once and keep the IDs next to your offices:
curl "https://api.prismareviews.com/v1/locations" \
-H "Authorization: Bearer $PRISMA_API_KEY"An office with a Google listing and a Yelp page has two locations. Pass both, separated by commas, to get one list.
2. Ask for the reviews that mention the employee
Put the names a customer might use in q, separated by commas: any of them matches. A name with a space is matched as a phrase.
curl -G "https://api.prismareviews.com/v1/reviews" \
--data-urlencode "location_id=loc_01KJ8P9W2C4D6F8G0H2J4K6M8N,loc_01KJ8PA3B5C7D9E1F3G5H7J9K1" \
--data-urlencode "q=John Carter,John,Johnny" \
--data-urlencode "min_rating=4" \
--data-urlencode "limit=20" \
-H "Authorization: Bearer $PRISMA_API_KEY"{
"data": [
{
"id": "rev_01KJ8Q2M4T7HX3VB9CWD6NRZ5E",
"platform": "google_maps",
"location_id": "loc_01KJ8P9W2C4D6F8G0H2J4K6M8N",
"location_name": "Acme Insurance, Seattle",
"location_url": "https://www.google.com/maps/place/…",
"rating": 5,
"title": null,
"text": "Johnny walked me through every option and found a better policy in ten minutes.",
"author": "Marta G.",
"url": "https://www.google.com/maps/reviews/…",
"created_at": "2026-10-19T12:41:07.000Z",
"reply": { "text": "Thanks Marta! We'll tell Johnny.", "status": "published", "created_at": "2026-10-20T09:02:11.000Z", "error": null },
"matched_terms": ["Johnny"]
}
],
"next_cursor": null
}How the search behaves:
- Whole words, any case, any accent.
Annfinds “Ann” and “ANN”, not “Annual” or “Annmarie”.Josefinds “José”. - Several names, OR.
q=John,Johnny,John Carterreturns reviews with any of them. Up to 10 names. - Text and title only. A reviewer who happens to be called John isn’t a mention of your employee John. Add
q_in=text,title,authorif you want those too. matched_termslists the names each review matched, as you sent them. A review that names two employees comes back in both searches.- Combine freely with
since,until,min_rating,max_rating,platformandhas_reply, and page withnext_cursor(send the same filters with each page).
Just connected? A location’s first import takes a few minutes. Until it has loaded, the response lists it in meta.pending_locations with its sync_status (queued, importing…): show “reviews loading” rather than “no reviews yet”.
Common first names (“Will”, “Grace”, “Rose”) also match ordinary words. Prefer the full name or a nickname that is rarely a word, and check what comes back before you publish a page.
One call per office instead of one per employee
To fill every profile in an office at once, ask once with all the names, then use matched_terms to sort each review into the right profile:
const staff = { "john-carter": ["John Carter", "John", "Johnny"], "mary-ann-lee": ["Mary Ann", "Mary Ann Lee"] };
const q = Object.values(staff).flat().join(",");
// ...GET /v1/reviews?location_id=…&q=… and follow next_cursor...
const byEmployee = {};
for (const review of reviews) {
for (const [slug, names] of Object.entries(staff)) {
if (review.matched_terms.some((t) => names.includes(t))) (byEmployee[slug] ??= []).push(review);
}
}3. Keep the API key on your server
Never put your API key in browser JavaScript: anyone could read it. Call Prisma from your server (or a serverless function) and give the page only what it shows. A minimal Node.js route, cached for an hour so a busy page doesn’t call Prisma on every visit:
// GET /api/employee-reviews?employee=john-carter
const EMPLOYEES = {
"john-carter": { locations: ["loc_01KJ8P9W2C4D6F8G0H2J4K6M8N"], names: ["John Carter", "John", "Johnny"] },
};
const cache = new Map();
export async function employeeReviews(slug) {
const e = EMPLOYEES[slug];
if (!e) return [];
const hit = cache.get(slug);
if (hit && hit.until > Date.now()) return hit.reviews;
const params = new URLSearchParams({ location_id: e.locations.join(","), q: e.names.join(","), min_rating: "4", limit: "20" });
const res = await fetch("https://api.prismareviews.com/v1/reviews?" + params, {
headers: { Authorization: "Bearer " + process.env.PRISMA_API_KEY },
});
if (!res.ok) throw new Error("Prisma " + res.status);
const { data } = await res.json();
const reviews = data.map((r) => ({
rating: r.rating, text: r.text, author: r.author, date: r.created_at, platform: r.platform,
office: r.location_name, link: r.url || r.location_url, reply: r.reply && r.reply.status === "published" ? r.reply.text : null,
}));
cache.set(slug, { reviews, until: Date.now() + 3600_000 });
return reviews;
}4. Show them on the profile
A minimal block for the employee’s page. It reads your own route, not Prisma, and writes the text with textContent so a review can’t inject HTML into your page:
<section id="employee-reviews" data-employee="john-carter">
<h2>What customers say about John</h2>
<ul class="reviews"></ul>
</section>
<script>
const box = document.getElementById("employee-reviews");
fetch("/api/employee-reviews?employee=" + encodeURIComponent(box.dataset.employee))
.then((res) => res.json())
.then((reviews) => {
if (!reviews.length) { box.hidden = true; return; }
const list = box.querySelector(".reviews");
for (const r of reviews) {
const li = document.createElement("li");
const stars = document.createElement("strong");
stars.textContent = "★".repeat(r.rating || 0) + "☆".repeat(5 - (r.rating || 0));
const text = document.createElement("p");
text.textContent = r.text || "";
const meta = document.createElement("small");
meta.textContent = `${r.author || "A customer"} · ${r.office} · ${new Date(r.date).toLocaleDateString()}`;
li.append(stars, text, meta);
if (r.reply) {
const reply = document.createElement("blockquote");
reply.textContent = "Reply: " + r.reply;
li.append(reply);
}
if (r.link) {
const a = document.createElement("a");
a.href = r.link; a.rel = "nofollow noopener"; a.target = "_blank";
a.textContent = "See it on " + (r.platform.startsWith("google") ? "Google" : r.platform);
li.append(a);
}
list.append(li);
}
});
</script>Render it on the server instead if you want the reviews in the page’s HTML from the first byte; the data is the same.
Showing reviews on your site
You are showing customer reviews of your own business. Keep them as written, show the author’s name and the platform, and link to the review or to your listing on that platform (url, or location_url when a review has no link of its own). Platforms set their own display rules; Google’s, for example, ask for attribution and a link back. Prisma doesn’t return author photos.
Related
- Reviews reference: every filter and field.
- MCP server: the same search from Claude or another AI assistant (“reviews of the Seattle office that mention John”).
- Public page & badge: a hosted page and a rating badge, without code.