A high-performance REST API built with Go for parsing RSS/Atom feeds and extracting comprehensive source information from URLs. The API provides endpoints to analyze feeds and extract metadata, making it easy to integrate feed parsing capabilities into your applications.
- π Fast URL Parsing: Extract feed information from any URL
- π‘ Source Analysis: Comprehensive source metadata extraction
- π API Key Authentication: Secure access with Bearer token authentication
- π Rate Limiting: Built-in rate limiting for API protection
- π₯ Health Monitoring: Health check endpoints for service monitoring
- π OpenAPI Documentation: Complete API specification included
- π³ Docker Support: Containerized deployment ready
- Clone the repository:
git clone https://github.com/lufeed/feed-parser-api.git
cd feed-parser-api- Install dependencies:
go mod download- Set up configuration:
export CONFIG_FILE=config-local.yml- Run the application:
go run cmd/server/main.goThe API will be available at http://localhost:7654/api
docker build -t lufeed-parser-api .
docker run -p 7654:7654 -e CONFIG_FILE=config-prod.yml lufeed-parser-apiCreate a configuration file (e.g., config-local.yml):
service:
name: lufeed-feed-parser-api
environment: development
server:
host: 0.0.0.0
port: 7654
root_path: "/api"
log:
level: debug
format: json
auth:
api_keys:
- your-api-key-1
- your-api-key-2All API endpoints (except /ping) require authentication using API keys:
curl -H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
https://DOMAIN_NAME/api/v1/parsing/urlGET /pingResponse:
{
"message": "pong",
"service": "lufeed-feed-parser-api"
}POST /v1/parsing/url
Content-Type: application/json
Authorization: Bearer your-api-key
{
"url": "https://example.com/feed.xml"
}Response:
{
"code": 200,
"message": "Success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"title": "Tech News Daily",
"description": "Latest technology news and updates",
"url": "https://example.com/feed.xml",
"image_url": "https://example.com/image.jpg",
"published_at": "2023-12-01T10:30:00Z"
}
}POST /v1/parsing/source
Content-Type: application/json
Authorization: Bearer your-api-key
{
"url": "https://example.com"
}Response:
{
"code": 200,
"message": "Success",
"data": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Tech News Site",
"description": "A comprehensive technology news website",
"feed_url": "https://example.com/feed.xml",
"home_url": "https://example.com",
"image_url": "https://example.com/logo.jpg",
"icon_url": "https://example.com/favicon.ico"
}
}{
"message": "Invalid URL format"
}Common HTTP status codes:
200- Success400- Bad Request (invalid URL or request body)401- Unauthorized (missing or invalid API key)429- Too Many Requests (rate limit exceeded)500- Internal Server Error
Complete OpenAPI 3.0 specification is available in openapi.yaml. You can use tools like Swagger UI or Postman to explore the API interactively.
# Serve the OpenAPI spec with Swagger UI
npx swagger-ui-serve openapi.yamlβββ api/ # API layer
β βββ initialize.go # API initialization
β βββ v1/ # Version 1 endpoints
β βββ parsing/ # Parsing endpoints
β βββ init.go # Route setup
βββ cmd/
β βββ server/ # Application entry point
βββ internal/ # Internal packages
β βββ cache/ # Redis caching
β βββ config/ # Configuration management
β βββ database/ # Database connections
β βββ logger/ # Logging utilities
β βββ middleware/ # HTTP middleware
β βββ models/ # Data models
β βββ parser/ # URL/feed parsing logic
β βββ types/ # Common types
βββ openapi.yaml # API specification
βββ README.md # This file
go build -o bin/server cmd/server/main.goUse the /ping endpoint for health monitoring:
curl http://localhost:7654/api/pingStructured JSON logging is available with configurable levels:
debug- Detailed debugging informationinfo- General informationwarn- Warning messageserror- Error messages
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support, please open an issue on GitHub or contact the development team.