Coder Social home page Coder Social logo

jpmurray / canada-sale-tax-api Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 1.0 424 KB

API to retrieve canadian federal and provincial tax rates. Documentation and endpoints on the website:

Home Page: http://salestaxapi.ca

PHP 71.82% JavaScript 0.83% Vue 0.41% Shell 0.37% Blade 26.57%
hst canada api pst tax-rate tax-rates taxes gst

canada-sale-tax-api's Introduction

Canada's sale taxes API

Here's an API to get canadian sales tax informations. Simple as that.

The API is now at v2. Please see the documentation for usage.

If you see any discrepancies in actual data, missing future rates or want to contribute historical rates, please open an issue on the Github repository with the data and we'll include it in the API.

Documentation

Rate limit

API usage is curently rate limited at 60 hits per minutes. The rate limit is subject to change upon API popularity.

Contributing

You know the drill: report bugs in issue, suggest features in issue and if you can, submit pull requests!

License

MIT license.

canada-sale-tax-api's People

Contributors

jpmurray avatar lazluiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lazluiz

canada-sale-tax-api's Issues

Make an API endpoint with upcoming changes, if any

Taxes rates come and go. Not that much, but still. It's been pointed to me that people could benefit from an endpoint that would say if there is any planned changes to some tax rates, and if yes, when.

That way people could be notifying clients of rates changes, or update their local cached rates for example.

api.salestaxapi.ca is down

Not sure if this is the most appropriate place for this, but curl https://api.salestaxapi.ca/v2/province/all seems to timeout for me at the moment.

Wrong HST for Saskatchewan

Hey, thanks for creating this API. Looks like something is wrong with Saskatchewan taxes. HST should be 0. Now it returns 0.11.

Create an endpoint for special cases

Quick example:

  • return type of goods/services that are exempted for a rate;
  • return type of goods/services that have special extra rates (ex.: Manitoba has a 5% tax on hotel room fees)

Put the rates outside of controller

Curently, the rates are hardcoded in app/Traits/Rates.php. The reasoning behind this is that I didn't want to make request to a database for this kind of small information, and using a database would just add to the response time of the API.

I could still switch to a database and use redis as a caching method. Benefit of this would be keeping an archive of past rates more easily.

But I could also use json files with the information, that would keep things blazing fast.

Will have to think about this.

Unable to access from website

Hi. I am trying to create a website and wanted to use this api for accessing tax details.
It's not working though. There are different errors every time. Sometimes its cors, sometimes, its invalid response.

Help please

Add a value to responses to let know of upcoming changes

Currently, a user can access future rates using, for example, the /v2/federal/gst/future endpoint.

I think it would be good to also include a value to (following the same example) /v2/federal/gst/ to let the user know if there is any upcoming changes.

Would be false or a datetime value.

Missing CORS Header

Unable to query API within other sites

- Unsure if this is an intended effect (sorry if so)


At the moment the api cannot be queried from other websites and the URL must be entered manually.
This is due to a missing response header.

Cross-Origin Resource Sharing A security feature that by default disallows foreign requests to a server for security purposes. (ie to prevent spoofing) CORS must be allowed by supplying the following response header Access-Control-Allow-Origin: *
With * Meaning any origin, if this header is missing then the client's browser will block the request.

I was interested in using this api for a personal project and was disappointed to see the request fail. If this behavior is intended or you are no longer interested in maintaining this project then I completely understand!


Otherwise I hope you would be amenable to implementing the fix suggested above. (Unfortunately I'm not so knowledgeable in PHP as to be able to implement this change myself otherwise I wouldn't bother you as such)

Thanks either way and happy coding!

Getting a 301 response on all calls?

I'm unable to retrieve any values for GST or provincial tax rates at the moment. I'm just getting a 301 response back. Am I missing something special that I have to include in the request?

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.