Vinted Image Search Assistant
import logging
import os
import requests
from gunicorn.app.base import BaseApplication
from app_init import create_initialized_flask_app
from abilities import upload_file_to_storage, url_for_uploaded_file, llm
from flask import render_template, request, redirect, url_for, flash, jsonify
from werkzeug.utils import secure_filename
# Flask app creation should be done by create_initialized_flask_app to avoid circular dependency problems.
app = create_initialized_flask_app()
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
def allowed_file(filename):
return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
@app.route("/")
def home():
return render_template("home.html")
Created: | Last Updated:
Here's a step-by-step guide for using the Vinted Image Search Assistant template:
Introduction
The Vinted Image Search Assistant is a web application that allows users to upload images, analyze them using AI, and search for similar items on Vinted using an API. This template provides a user-friendly interface for image upload and displays search results from Vinted.
Getting Started
- Click "Start with this Template" to begin using the Vinted Image Search Assistant template in the Lazy Builder interface.
Initial Setup
Before running the application, you need to set up an environment secret:
- Go to the Environment Secrets tab in the Lazy Builder.
- Add a new secret with the key
RAPIDAPI_API_KEY
. - To get the value for this key:
- Visit RapidAPI
- Sign up or log in to your account
- Subscribe to the Vinted3 API
- Copy your API key from the RapidAPI dashboard
Test the Application
- Click the "Test" button in the Lazy Builder interface to deploy and run the application.
- Wait for the deployment process to complete.
- Once deployed, you'll receive a server link to access the web application.
Using the App
- Open the provided server link in your web browser.
- You'll see the home page with options to upload an image or take a photo.
- Choose an image file or use your device's camera to capture a photo.
- Click the "Find Similar Items" button to analyze the image and search for similar items on Vinted.
- The results page will display:
- Image analysis results (colors, category, and keywords)
- Similar items found on Vinted, including images, titles, prices, and links to view the items on Vinted
Integrating the App
This web application is standalone and doesn't require additional integration steps. Users can access and use it directly through the provided server link.
By following these steps, you'll have a fully functional Vinted Image Search Assistant that allows users to find similar items on Vinted based on uploaded images.