Skip to content

Restful API for the Casablanca Stock Exchange with Spring Boot and Jsoup

License

Notifications You must be signed in to change notification settings

AmineDaou/casablanca-bourse-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Casablanca Bourse API

Documentation

Test: Root URL

Here is a root url to test the api http://casablanca-bourse-api.herokuapp.com/.

Get Companie

Returns json data about a single companie.

  • URL

    /api/v1/companies/:name

  • Method:

    GET

  • URL Params

    Required:

    name=[string]

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: {"name":"COSUMAR","status":"T","referencePrice":305.0,"open":307.3,"lastPrice":324.95,"numberOfSharesTraded":83189,"volume":2.664651285E7,"change":6.54,"intradayHigh":324.95,"intradayLow":307.2}
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Companie doesn't exist" }
  • Sample Call:

      $.ajax({
        url: "/api/v1/companies/COSUMAR",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });

Get Companies

Returns json data about all the companies.

  • URL

    /api/v1/companies/

  • Method:

    GET

  • URL Params

None

  • Data Params

    None

  • Success Response:

    • Code: 200
      Content: [{"name":"COSUMAR","status":"T","referencePrice":305.0,"open":307.3,"lastPrice":324.95,"numberOfSharesTraded":83189,"volume":2.664651285E7,"change":6.54,"intradayHigh":324.95,"intradayLow":307.2}
      ...
      {"name":"TIMAR","status":"N.T","referencePrice":313.0,"open":null,"lastPrice":313.0,"numberOfSharesTraded":0,"volume":null,"change":0.0,"intradayHigh":null,"intradayLow":null}]
  • Error Response:

    • Code: 404 NOT FOUND
      Content: { error : "Empty ressource" }
  • Sample Call:

      $.ajax({
        url: "/api/v1/companies/",
        dataType: "json",
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });

About

Restful API for the Casablanca Stock Exchange with Spring Boot and Jsoup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published