Giter Club home page Giter Club logo

api-news-stub's Introduction

Stubbed News API

This micro-api is for testing purposes only.

The purpose of this project is to provide a static list of posts that present data in an identical manner to the real Stockflare News API, so that the API is easy to develop over.

Supported Calls

method url description example paginated?
GET /posts Retrieve all the latest posts /posts?page=2&per_page=4 yes
GET /posts/:id Retrieve specific post by its ID /posts/1 no
GET /tags/:tag Retrieve posts that have a specific tag /tags/china yes

Paginated Responses

Paginated responses contain an X-Pagination header that has a serialized JSON objected within it, here is an example of the header contents:

{"next":2,"previous":0,"current":1,"per_page":30,"count":5,"total":12,"pages":1}

If given the above header contents, you then sent a second request for page 2, the API will return 404. The API favors returning a 404 response over an empty body.

The contents of this header may be used to determine the length of the paginated response, as well as if the end of the pagination has been reached.

api-news-stub's People

Contributors

davidkelley avatar

Watchers

Paweł avatar James Cloos avatar Roman Pavlov avatar Shane Leonard avatar Mark Stratmann avatar  avatar Jonathan Kelley 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.