Inspiration

I’ve always been fascinated by the idea of uncovering truth in a world full of misinformation. The Perplexity Hackathon 2025, with its Sonar API, sparked my imagination to create TruthSeeker AI—an app that verifies statements with a fun, explorer-themed twist. I envisioned a treasure hunt for facts, where users could embark on a journey to discover whether statements are true, complete with animations and a vibrant design to make learning engaging.

What it does

TruthSeeker AI lets users input statements (e.g., “Is 1+1=2?”) and uses the Perplexity Sonar API to verify them, delivering a clear verdict—“Truth Found!” or “Truth Elusive!”—along with a concise explanation. The app features a colorful explorer theme with animated gradients, a treasure map overlay, verdict animations, and a typewriter header. It also displays clickable sources with live-fetched page titles, ensuring credibility, and includes a feedback system for user input. It’s both educational and entertaining!

How we built it

I built TruthSeeker AI as a web app using HTML and JavaScript for the frontend, with Vercel for deployment. The Perplexity Sonar API (llama-3.1-sonar-large-128k-online) powers the truth verification, called via a serverless proxy function (api/proxy.js). I used CSS animations for the explorer theme, including gradients and a typewriter effect. To enhance usability, I fetched page titles for citations server-side by parsing HTML <title> tags, ensuring a polished experience. The app was iteratively tested and deployed using Git and Vercel CLI.

Challenges we ran into

The biggest challenge was debugging API issues—initially, the app hit a 504 Gateway Timeout due to an incorrect endpoint (v1/sonar). After testing with Postman, I discovered the correct endpoint (chat/completions) but then faced a 404 Not Found error. Adjusting the endpoint fixed this, but displaying citations was tricky since the API returned raw URLs. I overcame this by implementing server-side title fetching, handling timeouts, and ensuring graceful fallbacks. Balancing performance with Vercel’s serverless limits was another hurdle, but I optimized with parallel fetching and timeouts.

Accomplishments that we're proud of

I’m proud of creating a visually stunning app that’s both functional and fun! The explorer theme—with its animated background, treasure map, and verdict animations—makes truth-seeking an adventure. Successfully fetching page titles for citations added a professional touch, and the app’s accessibility (e.g., keyboard navigation) ensures inclusivity. I’m also proud of overcoming API challenges, delivering a stable app that aligns with the hackathon’s Most Fun / Creative Project and Best Use of Sonar API categories.

What we learned

This project taught me how to integrate and debug third-party APIs like Perplexity’s Sonar API, from handling rate limits to parsing responses. I deepened my JavaScript skills, especially with async/await for parallel requests, and learned to optimize serverless functions on Vercel. I also gained experience in UX design, ensuring animations enhance rather than distract from the user experience, and the importance of accessibility in app development.

What's next for TruthSeeker AI

I plan to enhance TruthSeeker AI by adding multilingual support, allowing users worldwide to verify truths in their native languages. I’d also like to integrate a history feature to track past queries and improve the title-fetching mechanism with a caching layer to boost performance. Finally, I aim to expand the app’s educational scope by adding interactive quizzes, making it a go-to tool for learning and critical thinking.

Built With

  • css-**frameworks**:-none-(vanilla-javascript-for-lightweight-performance)-**platforms/cloud-services**:-vercel-(for-hosting-and-serverless-functions)-**apis**:-perplexity-sonar-api-(`llama-3.1-sonar-large-128k-online`)-**tools**:-git-(version-control)
  • for
  • javascript
  • languages**:-html
  • obs-studio-(video-recording)-**other**:-css-animations-for-the-explorer-theme
  • postman-(api-testing)
  • regex
  • server-side
  • title
Share this project:

Updates