Finding a furry companion isn’t always easy. Adoption sites can be overwhelming, and filtering through listings to find the perfect match can take hours. That’s where Rover comes in—a simple, free app that uses ChatGPT to interpret natural language queries and deliver tailored results from the PetFinder API.
Let’s be clear: we’re not doing anything revolutionary here. But if we can make the adoption search easier, and even help a single dog find a forever home, we’ve done our job. In this article, we’ll explore how Rover works, the tools that power it, and how you can replicate or build upon this idea for your own projects.
At its core, Rover is a Flask-based web app that combines the conversational power of ChatGPT with the extensive database of adoptable pets from the PetFinder API. Here’s the high-level flow:
Live Demo: You can try the app yourself at lambdasandlapdogs.com/rover.
Open Source: A standalone proof-of-concept is available on GitHub: Rover Repository. Feel free to fork it, use it, or improve it.
Rover leverages several technologies to transform queries into adoptable matches:
The app is built on Flask, a lightweight Python web framework, which handles routing, user input, and interactions with ChatGPT and the PetFinder API. For example, here’s a snippet of the business logic in app.py
:
@app.route('/', methods=['GET', 'POST']) def render_dog_finder(): if request.method == 'POST': # Initialize Petfinder client petfinder_api = PetfinderClient(petfinder_key, petfinder_sec) petfinder_api.auth() # Get the user description from the form user_description = request.json.get('description', '') # Step 1: Use GPT-4o-mini to process the description try: gpt_response = openai.chat.completions.create( ...)
ChatGPT interprets user queries, transforming human language into structured API parameters. For example:
User Query: “I’m looking for a playful puppy near Dallas.”
Structured Output:
{ "type": "dog", "age": "baby", "location": "Dallas, TX" }
Here's the prompt that makes this possible:
You are an assistant helping users find adoptable dogs using the Petfinder API.
Always include the following parameters in the JSON output:
- status (always set to 'adoptable')
Include the following parameters **only if relevant**:
- breed (if mentioned in the description)
- size (one of 'small', 'medium', 'large', 'extra-large')
- gender (one of 'male', 'female')
- age (one of 'baby', 'young', 'adult', 'senior')
- color (if mentioned in the description)
- coat (one of 'short', 'medium', 'long', 'wire', 'hairless', 'curly')
- location (if mentioned in the description)
- good_with_children (1 or 0)
- good_with_dogs (1 or 0)
- good_with_cats (1 or 0)
Output valid JSON only, with no extra text or commentary.
The app uses these parameters to query the PetFinder API, which returns detailed listings of adoptable pets. Thanks to its robust filtering capabilities, we can ensure that users only see the results that matter most.
If you'd like to dive into the module we developed to facilitate and streamline interaction with the PetFinder API, be sure to check out that set of code here.
Results are dynamically displayed on the page using JavaScript for a seamless user experience. The template (index.html
) provides the foundational structure of the page, while JavaScript handles rendering the results in real time.
You can view the app’s core logic here:
Rover is completely free to use—no ads, no hidden fees, just a love for connecting people with adoptable dogs. We don't even care about your data. We’re using OpenAI’s GPT-4o-mini model to process queries, which makes natural language search both powerful and cost-effective.
At
By leveraging affordable AI pricing, we’re able to keep Rover accessible to everyone, simplifying the adoption search while bridging the gap between dogs in need and their potential owners.
50,000 chances to find a new best friend? Those odds are pretty decent.
While this work isn’t revolutionary, its purpose is simple: to make adopting a dog easier and more approachable. For anyone who’s ever felt overwhelmed navigating adoption sites, this app aims to reduce friction and save time.
We know this project won’t change the world, but it might change a dog’s life—and that’s enough for us.
We’d love for you to give Rover a try or even create your own version. Here’s how you can get started:
Rover is a small project with a big heart. It’s powered by accessible technology like ChatGPT, the PetFinder API, and Flask to help make dog adoption a little easier. We hope it inspires others to explore how AI and open data can create meaningful, simple solutions to real-world problems.
If Rover helps one dog find a loving home, we’ve done our job. But if it helps more, all the better.
There are no datasets linked
There are no datasets linked