Giter VIP home page Giter VIP logo

best-api's Introduction

best-api

my view of what would be the best way to implement an api

why?

i think that most apis are way too hard to use and these are some ideas to make them better

Auth

apis should be able to be authenticated to in multiple ways including: url api key, headers, oath, and maybe some fancy ip-linking thingymagic

Endpoints

i think that endpoints should be straightforward and not hard to understand, for example: if you want to query a user's followers count you would do: api.yoursite.com/user/{name}/followers you should also be able to request data in multiple formats like: plain for for example a integer or json or yml for a full page if you have a social site you should be able to prefix someones page with api. to view their data in a nice programmable format, maybe with url parameters for auth but the page should always be accessible in a ratelimited way without auth. I personall really like REST but it just lacks a way to only query one field, graphql tries to fix this but their fault is that the query will become really unreadable if you need a lot of very specific features And just PLEASE have some websocket endpoint for events like followers in the end a REST/graphql mix with a websocket endpoint would be the best.

Ratelimiting

I know that ratelimiting is required but PLEASE dont force me to do less than 1 request per minute or something, this is really annoying and i strongly suggest to use either a monthly limit or use wundergrounds raindrop system

errors

errors should be nicely formatted any should not just show a *** error for the thing you are trying to look up, the most useful way to do this is to make all fields shows up as "Not Found" instead of making the developer have to spend hours trying to figure out where he went wrong.

old apis

keep old apis working for as long as possible so that even unmaintained but still used projects can be used or community-updated

Docs

documentation is one of the biggest thing in a api, it should be simple at first glance but there should be like dropdowns for more advanced stuff

Performance

try to make your api as fast as possible, this is common sense but some people still have their apis on cheap low end machines

Community input

accept community input for the docs and for api ideas to make it usefull for everyone.

best-api's People

Contributors

wqrld avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.