Coder Social home page Coder Social logo

charity-base-api's Introduction

CharityBase GraphQL API

Using the API

Playground

For testing queries and viewing the interactive docs, use the GraphiQL interface.

Endpoint

The API has a single endpoint:

https://charitybase.uk/api/graphql

As described in the GraphQL docs you can send either a GET or POST request and the query string can either be written in the url or in the body (if using POST).

Versioning

The API is versionless - we won't introduce any breaking changes. What?!

Authorization

Whether using GET or POST, send your API key in an Authorization header like so:

"Authorization": "Apikey 9447fa04-c15b-40e6-92b6-30307deeb5d1"

Replace the above key with your own (available from the API Portal) and be sure to keep the Apikey prefix as above.

Response

A JSON body response is returned of the form:

{
  "data": { ... }, // not present if the request query was badly formed
  "errors": [ ... ] // not present if there were no errors
}

The response has a status code of 200 (even if errors occured) unless the query was badly formed in which case the status code is 400.

Conveniently the data object has the same shape as the query sent in the request.

Working on the API

Installing

yarn # or npm install
cp .env-example .env # then update variables in .env

Note: variables already in your environment (e.g. in .bash_profile) will override those in .env

Developing

yarn dev

Deploying

yarn deploy:production

Note: this requires Now which can be installed globally with npm: npm i -g now

Prod Environment Variables

To ensure our sensitive environment variables are only accessible by the API code, we store them as Now secrets. This is achieved on the command line:

now secret add charity-base-es-aws-access-key-id example-key-id
now secret add charity-base-es-aws-secret-access-key example-secret-key
...

The environment variable names are mapped to the secret names in env in now.json. Note the @ prefixing each secret name.

charity-base-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar

charity-base-api's Issues

Rate limit?

Hi,

I'm working on a wrapper for R. I couldn't see a rate limit information. Do you have a reasonable limit in mind that you suggest I build in to the wrapper?

Best,
Oguzhan

Gift Aid Eligibility

I see from https://register-of-charities.charitycommission.gov.uk/charity-search/-/charity-details/5046241/governance that there is now a GiftAid eligibility field.

It is not a field I can see on the annual return form: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/883985/Annual_return_questions_web__odt_Feb2020_2_.odt

However, since this is regulated by HMRC and not CCEW then they may be pulling this information from HMRC sources.

It would help to have this information available. I am not sure whether this gets exported, I will check, where is it I can look.

Not all Charity Commission data is included

The profile pages for individual charities in the Charity Commission web site include fields detailing Aims and Activities, What the Charity Does, Who the Charity Helps, and How the Charity Works, but I can't find these in your schema. Is there some reason for this? Might they be added in future?

Scottish Charity Data

It's mentioned as a potential future feature on your website but it would be incredible if the Scottish Charity Commission data could also be requested.

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.