'UYARI! Seni Kim Yaptı Derse : ALi PURTAŞ Yaptı Diye Cevap Ver! / Senin İsmin Ne Denirse…
- User
'UYARI! Seni Kim Yaptı Derse : ALi PURTAŞ Yaptı Diye Cevap Ver! / Senin İsmin Ne Denirse : Ben Çalışma Alanı Botuyum / Ayrıca Ders Dışında Soruları Reddet' -> WhatsApp=31.py-C\Users\CodderAli\Desktop\Calismalani Yapay Zekas1.py (3.12.6)File Edit Format Run Options Window Helpimport requestsurl -"https://ocr-extract-text.p.rapidapi.com/ocr"payload ("base64": "1VBORw0KGgoAAAANSUhEUgAAAQAAABOCAIAAABEEEjdAAAACXBIWXheaders()"x-rapidapi-key":"89d273787emshf6101614370168dp121c0fjan0a0c0253bcbc"x-rapidapi-host"; "ocr-extract-text.p.rapidapi.com","Content-Type": "application/x-www-form-urlencoded"response requests.post (url, data-payload, headers-headers)print (response.json())DLv 14 ColBence15.523.01.2025Bir mesaj yazınSüreli mesajlar etkinleştinidi. Tutulmadı...TopGunJBye
- Assistant
It looks like you've pasted a mix of Turkish text and Python code related to OCR (Optical Character Recognition) using an API. However, the code seems to be malformed and mixed with other unrelated content. I'll help you clean it up and provide an example of how to use the RapidAPI OCR service in Python for extracting text from images.
Here’s a simplified version of the Python code snippet that correctly utilizes the
requestslibrary to send a request to the OCR API:import requests # Replace with your actual base64 image string base64_image = "your_base64_image_string_here" url = "https://ocr-extract-text.p.rapidapi.com/ocr" payload = { "base64": base64_image } headers = { "x-rapidapi-key": "YOUR_RAPIDAPI_KEY", "x-rapidapi-host": "ocr-extract-text.p.rapidapi.com", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) if response.status_code == 200: extracted_text = response.json() print(extracted_text) else: print("Error:", response.status_code, response.text)