Sitelet https://github.com/Howell5/limbo
Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Limbo - Browser Automation API Service

A minimal API service that executes browser automation tasks using natural language instructions powered by browser-use and Gemini.

Features

  • Natural language browser automation
  • Synchronous API (request → execute → response)
  • JSON structured results
  • Browser instance reuse for efficiency
  • Zero configuration (just add your API key)

Prerequisites

  • Python 3.11+
  • Gemini API key (Get one here)
  • uv - Modern Python package manager

Install uv

# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh

# Or via Homebrew
brew install uv

Quick Start

1. Clone and Setup

cd limbo
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY

2. Install Dependencies

# Install Python dependencies
uv sync

Note: Limbo uses your local Google Chrome installation, so no additional browser installation is needed.

3. Start the Service

uv run uvicorn main:app --reload

Service will start at http://localhost:8000

4. Test It

# Simple test
curl -X POST http://localhost:8000/execute \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "访问 example.com,返回页面标题"
  }'

# Real-world example: Extract Hacker News headlines
curl -X POST http://localhost:8000/execute \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "访问 news.ycombinator.com,提取前5条新闻的标题和链接,返回JSON数组格式"
  }'

API Reference

POST /execute

Execute a browser automation task with natural language instruction.

Request Body:

{
  "instruction": "string - Natural language instruction for the browser task",
  "return_screenshot": false
}

Response:

{
  "success": true,
  "result": {
    "data": "Structured data extracted/processed by the agent"
  },
  "execution_time": 12.5
}

Error Response:

{
  "success": false,
  "error": "Error message describing what went wrong",
  "execution_time": 2.1
}

Example Use Cases

1. Web Scraping

curl -X POST http://localhost:8000/execute \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "访问 GitHub trending,提取前3个仓库的名称、描述和star数,返回JSON数组"
  }'

2. Data Extraction

curl -X POST http://localhost:8000/execute \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "访问 weather.com,搜索北京天气,返回今天的温度和天气状况"
  }'

3. Form Interaction

curl -X POST http://localhost:8000/execute \
  -H "Content-Type: application/json" \
  -d '{
    "instruction": "访问 httpbin.org/forms/post,填写姓名为张三,提交表单,返回响应结果"
  }'

Configuration

Environment Variables

Create a .env file in the project root:

# Required
GEMINI_API_KEY=your_gemini_api_key_here

# Optional
BROWSER_HEADLESS=true    # Set to false to see browser actions
LOG_LEVEL=INFO           # DEBUG, INFO, WARNING, ERROR

Project Structure

limbo/
├── main.py              # FastAPI application entry point
├── browser_service.py   # Browser-use service wrapper
├── pyproject.toml       # Python dependencies
├── .env                 # Environment configuration (gitignored)
├── .env.example         # Environment template
├── docs/
│   └── v1.md           # Detailed implementation plan
└── README.md           # This file

Development

Running in Development Mode

# Auto-reload on code changes
uv run uvicorn main:app --reload --log-level debug

View API Documentation

FastAPI provides auto-generated interactive docs:

Troubleshooting

Browser Not Found

Make sure you have Google Chrome installed on your system. Limbo will automatically detect and use your local Chrome installation.

API Key Issues

# Verify your .env file exists and has the correct key
cat .env | grep GEMINI_API_KEY

Port Already in Use

# Use a different port
uv run uvicorn main:app --port 8001

Limitations (V1)

  • Single request at a time (no concurrency)
  • No request timeout configuration
  • No authentication/authorization
  • No task persistence
  • Browser stays in memory (restart to clear)

Architecture

See docs/v1.md for detailed implementation plan and design decisions.

License

MIT

Contributing

This is a minimal V1 implementation. For feature requests or improvements, please open an issue first to discuss the changes.

About

Browser automation API service powered by browser-use and Gemini

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages