Web appOpen in Telegram

PostFlask app that interacts with the Waifu API to fetch and display tags and search for images based on parameters you prov…

6 March 2025
<
</> ᴍᴜᴋᴇsʜ </>
Flask app that interacts with the Waifu API to fetch and display tags and search for images based on parameters you provided. 🚀 ### Flask App Structure 1. Install Flask: Make sure you have Flask installed. You can do this via pip: pip install Flask 2. Create your Flask app: Below is the complete code for the Flask app: from flask import Flask, jsonify, render_template import requests app = Flask(__name__) @app.route('/') def home(): return render_template('index.html') @app.route('/tags') def get_tags(): url = 'https://api.waifu.im/tags' response = requests.get(url) if response.status_code == 200: data = response.json() return jsonify(data) else: return jsonify({'error': 'Request failed with status code:', 'status': response.status_code}), response.status_code @app.route('/search/<tag>') def search_images(tag): url = 'https://api.waifu.im/search' params = { 'included_tags': [tag], } response = requests.get(url, params=params) if response.status_code == 200: data = response.json() return jsonify(data) else: return jsonify({'error': 'Request failed with status code:', 'status': response.status_code}), response.status_code if __name__ == '__main__': app.run(debug=True) 3. Create Template File: Create a folder named templates in the same directory as your Flask app and create a file named index.html. <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Waifu App</title> </head> <body> <h1>Welcome to the Waifu App! 🌟</h1> <h2>Available Tags and Image Search</h2> <p>Use the following endpoints:</p> <ul> <li><a href="/tags">Get Tags</a></li> <li>Search Images: <a href="/search/maid">Maid Images</a></li> </ul> </body> </html> How to Run the App 1. Save the Python script (e.g., app.py) and the HTML file. 2. Run the Flask app: python app.py 3. Open your web browser and go to http://127.0.0.1:5000/ to see the app in action! 🎉
15 · 2.8K ·

Nearby in the feed

<</> ᴍᴜᴋᴇsʜ </>Poll<</> ᴍᴜᴋᴇsʜ </>Poll
this message
रराम सियाराम सियाराम जय जय राम 🙏 तुम साथ हो जो मेरे, किस चीज की कमी है ।Jinke pass bhi Groups hain 10 members se 250 members tak ke vo mujhe de sakte hain (Only telegram groups no newly created) And don't comment here directly messa<</> ᴍᴜᴋᴇsʜ </>Poll
PPython Codes Basic to AdvancePython Codes Basic to Advance@Python_Codes_Pro · channel · Tech
2 562subscribers425posts in the index
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · What we do not do · Remove a page · Catalog · Search · How we count