跳到正文

0xtbug

unofficial-pddikti-api

Reverse-engineered API for PDDIKTI — Indonesian Higher Education Database. Provides access to universities, study programs, lecturers, and students data.

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

PDDIKTI Unofficial API

Reverse-engineered API for PDDIKTI — Indonesian Higher Education Database.

Provides access to universities, study programs, lecturers, and students data.

Quick Start

Manual Setup

# 1. Clone repository
git clone https://github.com/0xtbug/unofficial-pddikti-api
cd unofficial-pddikti-api

# 2. Start FlareSolverr (required)
docker run -d --name flaresolverr -p 8191:8191 --restart unless-stopped \
  ghcr.io/flaresolverr/flaresolverr:latest

# 3. Run
# Option A: Run directly with Go
go mod tidy
go run ./cmd/main.go

# Option B: Build & run binary
go build -o pddikti-api.exe ./cmd/main.go
./pddikti-api.exe

# 4. Test
curl http://localhost:8080/api/stats
# Production mode
docker-compose up -d

# Development mode (hot-reload with Air)
docker-compose up

# Stop all services
docker-compose down

Makefile Commands

CommandDescription
make helpShow all available commands
make runStart production (Docker)
make devStart development with hot-reload
make stopStop all containers
make logsView container logs
make buildBuild Docker images
make swaggerRegenerate Swagger docs
make build-localBuild binary locally
make testRun tests

Config

EnvDefaultDescription
PORT8080Server port
FLARESOLVERR_URLhttp://localhost:8191FlareSolverr URL (http://flaresolverr:8191 in Docker)
UPSTREAM_BASE_URLhttps://pddikti.kemdiktisaintek.go.id/apiPDDIKTI upstream
AUTH_ENABLEDfalseEnable Bearer token authentication (true/false)
API_TOKEN""Valid Bearer token when auth is enabled

Authentication

The API supports optional token authentication. When enabled, all /api endpoints require a valid token via the Authorization header. Both Authorization: Bearer and Authorization: (raw token) formats are accepted.

In Swagger UI, just enter the token value directly in the authorization dialog — no Bearer prefix needed.

EnvDefaultDescription
AUTH_ENABLEDfalseEnable/disable authentication (true/false)
API_TOKEN""The valid Bearer token

Example usage:

# Start server with auth enabled
AUTH_ENABLED=true API_TOKEN=my-secret-token go run ./cmd/main.go

# Make authenticated requests
curl -H "Authorization: Bearer my-secret-token" http://localhost:8080/api/stats

# Without auth (default)
go run ./cmd/main.go
curl http://localhost:8080/api/stats

When auth is disabled (AUTH_ENABLED=false), all requests pass through without a token.

Endpoints

Swagger UI: http://localhost:8080/swagger/index.html

Testing

# Run all tests with coverage
go test ./internal/... -cover -count=1 -timeout 120s

# Run specific package tests
go test ./internal/api/... -v
go test ./internal/middleware/... -v
go test ./internal/config/... -v

Docs

  • Swagger JSON — OpenAPI 3.0 spec

Stars History

Official distribution

获取与安装

暂未发现可确认的官方软件包地址

当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。

本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。