tanbaycu API Documentation

Powerful tools for developers, beautifully documented.

URL Shortening

Endpoint: /shorten-link

Shorten long URLs using various services (TinyURL, is.gd, v.gd).

Method
POST
URL
https://tanbaycu.vercel.app/shorten-link
Request Body
{
  "long_url": "https://example.com/very/long/url/that/needs/shortening"
}
Response
{
  "short_url": "https://tinyurl.com/abc123"
}

Sample Code (Python)

import requests

url = "https://tanbaycu.vercel.app/shorten-link"
data = {"long_url": "https://example.com/very/long/url/that/needs/shortening"}

response = requests.post(url, json=data)
print(response.json())

File Upload

Endpoint: /upload_file

Upload files to Gofile or Pixeldrain.

Method
POST
URL
https://tanbaycu.vercel.app/upload_file
Request
Send a multipart/form-data request with the file in the 'file' field.
Response
{
  "message": "Upload successful!",
  "link": "https://example.com/file"
}

Sample Code (Python)

import requests

url = "https://tanbaycu.vercel.app/upload_file"
files = {"file": open("example.txt", "rb")}

response = requests.post(url, files=files)
print(response.json())

Weather Information

Endpoint: /weather

Get current weather and forecast data.

Method
POST
URL
https://tanbaycu.vercel.app/weather
Request Body
{
  "latitude": 40.7128,
  "longitude": -74.0060
}
Response
{
  "current_weather": {
    "city": "New York",
    "temperature": 22.5,
    "description": "Partly cloudy",
    "humidity": 65,
    "wind_speed": 5.2
  },
  "forecast_info": [
    {
      "time": "2023-05-20 12:00:00",
      "temperature": 23.1,
      "description": "Sunny",
      "humidity": 60,
      "wind_speed": 4.8
    },
    // More forecast entries...
  ]
}

Sample Code (Python)

import requests

url = "https://tanbaycu.vercel.app/weather"
data = {"latitude": 40.7128, "longitude": -74.0060}

response = requests.post(url, json=data)
print(response.json())

Utilities

News API

Fetch top headlines.

GET https://tanbaycu.vercel.app/news

import requests

url = "https://tanbaycu.vercel.app/news"
response = requests.get(url)
print(response.json())

Math Operations

Perform mathematical operations.

POST https://tanbaycu.vercel.app/math

import requests

url = "https://tanbaycu.vercel.app/math"
data = {
  "operation": "simplify",
  "expression": "2x + 3x"
}
response = requests.post(url, json=data)
print(response.json())

Currency Exchange

Get latest exchange rates.

GET https://tanbaycu.vercel.app/crypto

import requests

url = "https://tanbaycu.vercel.app/crypto"
response = requests.get(url)
print(response.json())

Image Recognition

Analyze images and detect objects.

POST https://tanbaycu.vercel.app/image-recognition

import requests

url = "https://tanbaycu.vercel.app/image-recognition"
files = {"image": open("image.jpg", "rb")}
response = requests.post(url, files=files)
print(response.json())

Text Translation

Translate text between languages.

POST https://tanbaycu.vercel.app/translate

import requests

url = "https://tanbaycu.vercel.app/translate"
data = {
  "text": "Hello, world!",
  "target_language": "es"
}
response = requests.post(url, json=data)
print(response.json())

Sentiment Analysis

Analyze sentiment of text.

POST https://tanbaycu.vercel.app/sentiment

import requests

url = "https://tanbaycu.vercel.app/sentiment"
data = {
  "text": "I love this product! It's amazing!"
}
response = requests.post(url, json=data)
print(response.json())