A simple RESTful API for searching, sharing, and upvoting code snippets. Perfect for developers who want to quickly find and contribute reusable code.
Production API Base URL:
https://api.syntax-xxx.is-a.dev
- Add a new code snippet
- Search snippets by query, language, or tag
- Get a random snippet
- Upvote a snippet
POST /snippets
{
"title": "Hello World in Python",
"code": "print('Hello, world!')",
"language": "python",
"tags": ["beginner", "example"]
}GET /snippets?query=...&language=...&tag=...
GET /snippets/random
POST /snippets/{id}/upvote
- Interactive API docs:
/docs - Static info page:
/ - Developer test overlay:
/dev(for personal testing only)
- Install dependencies:
pip install fastapi uvicorn sqlalchemy pydantic
- Start the server:
uvicorn main:app --reload
- Open http://127.0.0.1:8000/ in your browser.
ALWAYS CHECK THE CODE YOU USE FOR MALICIOUS SOFTWARE. WE DO NOT GUARANTEE THAT ALL CODES ARE SAFE. IF YOU FIND MALICIOUS SOFTWARE, REPORT IT ON THE DISCORD.
If you find malicious code or have questions, please report it on the Discord server.