Skip to content

DIEGOHORVATTI/translate-api-google-node-vercel

Repository files navigation

Translate Google API V1

This project is a simple implementation of the Google Translate API using Node.js and Express, deployed on Vercel. It allows users to translate text between multiple languages effortlessly.

Features

  • Free and unlimited access to the Google Translate API
  • Automatic language detection
  • Simple RESTful API for text translation
  • Easy deployment and scalability using Vercel

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/translate-google-api-v1.git
    cd translate-google-api-v1
    
  2. Install dependencies using Bun:

    bun install
    
  3. Start the application:

    bun dev
    

Your API should now be running on http://localhost:3000/translate.

How to Use the API

You can use tools like Postman, curl, or any HTTP client to make requests to the API.

Example Request

To translate text, send a POST request to the /translate endpoint with the following JSON body:

Request URL:

POST http://localhost:3000/translate

Example Request Body:

{
  "text": "hello world",
  "from": "en",  // Optional: Source language (use "auto" for automatic detection)
  "to": "es"     // Target language
}

Example Response

You should receive a response similar to this:

"hola mundo"

API Endpoint

POST /translate

If the from field is omitted, the API will automatically detect the source language.

Deployment

This application is deployed on Vercel. You can access the live API at:

https://translate-google-api-v1.vercel.app/translate

Contributing

Feel free to fork this repository and submit pull requests. Any contributions are welcome!

Acknowledgments

  • Thanks to Google for providing the Translate API.
  • Thanks to Vercel for easy deployment options.

About

Free and Unlimited Google API without Token | Deploying Node with Express on Vercel

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published