Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SnipShare API

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

Features

  • Add a new code snippet
  • Search snippets by query, language, or tag
  • Get a random snippet
  • Upvote a snippet

Endpoints

Add a Snippet

POST /snippets

{
  "title": "Hello World in Python",
  "code": "print('Hello, world!')",
  "language": "python",
  "tags": ["beginner", "example"]
}

Search Snippets

GET /snippets?query=...&language=...&tag=...

Get a Random Snippet

GET /snippets/random

Upvote a Snippet

POST /snippets/{id}/upvote


Documentation

  • Interactive API docs: /docs
  • Static info page: /
  • Developer test overlay: /dev (for personal testing only)

Running Locally

  1. Install dependencies:
    pip install fastapi uvicorn sqlalchemy pydantic
  2. Start the server:
    uvicorn main:app --reload
  3. Open http://127.0.0.1:8000/ in your browser.

Disclaimer

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.


Contact / Reporting

If you find malicious code or have questions, please report it on the Discord server.

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages