API: SerpAPI Error: Your account has run out of searches issue fixed

This commit is contained in:
akash 2026-02-11 10:40:23 +05:30
parent ba5688d45a
commit d3db375654
3 changed files with 35 additions and 5 deletions

View File

@ -63,9 +63,24 @@ const About = () => {
}
function getProfileImage(r) {
const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail;
// Check multiple possible field names for profile images
const url = r.profile_photo_url ||
r.author_profile_photo_url ||
r.user?.thumbnail ||
r.user?.profile_photo_url ||
r.thumbnail ||
r.profile_picture ||
r.avatar;
if (!url) return null;
return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`;
// If it's already a full URL, return it
if (url.startsWith("http")) {
return url;
}
// Otherwise, construct the Googleusercontent URL
return `https://lh3.googleusercontent.com/${url}`;
}
function getInitials(name) {

View File

@ -1,5 +1,5 @@
export default async function handler(req, res) {
const apiKey = "37eb7f83988cfd76ffb5c5af9adc25652efe5607e39997fc7d0e054d690ef25e";
const apiKey = "8f20ae2ffd1700f38274ea87d2230ea8e0982834f8376bf311e7a4f5092662a8";
const placeId = "ChIJW9-CDf_X1IkRnBCKKZdqyvA";
// console.log("Pages API: Starting fetch for placeId:", placeId);

View File

@ -131,9 +131,24 @@ const TestimonialSection = () => {
}
function getProfileImage(r) {
const url = r.profile_photo_url || r.author_profile_photo_url || r.user?.thumbnail;
// Check multiple possible field names for profile images
const url = r.profile_photo_url ||
r.author_profile_photo_url ||
r.user?.thumbnail ||
r.user?.profile_photo_url ||
r.thumbnail ||
r.profile_picture ||
r.avatar;
if (!url) return null;
return url.startsWith("http") ? url : `https://lh3.googleusercontent.com/${url}`;
// If it's already a full URL, return it
if (url.startsWith("http")) {
return url;
}
// Otherwise, construct the Googleusercontent URL
return `https://lh3.googleusercontent.com/${url}`;
}
function getInitials(name) {