Skip to content

API Reference

Nginjen exposes a REST API on port 9090 (configurable). All endpoints accept and return JSON.

Base URL

http://127.0.0.1:9090

OpenAPI Spec

The full OpenAPI 3.1 specification is available at runtime:

bash
curl http://127.0.0.1:9090/openapi.json

You can view it in Swagger UI by pasting the spec URL, or use it to generate client libraries.

Endpoint Overview

Public (no auth)

MethodEndpointDescription
GET/healthHealth check
GET/openapi.jsonOpenAPI 3.1 spec
GET/wsWebSocket for session events

Protected (auth when api_key is set)

MethodEndpointDescription
POST/scrapeExtract page content
POST/screenshotCapture screenshot
POST/navigateNavigate to URL (stateless)
POST/evaluateExecute JavaScript (stateless)
GET/sessionsList active sessions
POST/sessionsCreate new session
DELETE/sessions/{id}Close a session
POST/sessions/{id}/navigateNavigate session
POST/sessions/{id}/executeExecute JS in session
GET/profilesList fingerprint profiles
POST/profilesCreate custom profile
GET/profiles/{name}Get profile details
DELETE/profiles/{name}Delete profile
GET/cookiesList cookie domains
GET/cookies/{domain}Get cookies for domain
POST/cookies/{domain}Save cookies
DELETE/cookies/{domain}Delete cookies
POST/searchWeb search

Response Format

All responses are JSON. Error responses follow this structure:

json
{
  "error": "Description of what went wrong",
  "code": "ERROR_CODE"
}

Rate Limiting

Concurrency is controlled via a semaphore (default: 5 concurrent pages). Requests that exceed the limit queue until a browser page is available.

Configure in config.toml:

toml
[server]
max_concurrent_pages = 10

Released under the MIT License.