{"id":13702205,"url":"https://github.com/charity-base/charity-base-api","last_synced_at":"2025-05-05T04:30:55.848Z","repository":{"id":12720932,"uuid":"72357611","full_name":"charity-base/charity-base-api","owner":"charity-base","description":"CharityBase GraphQL API","archived":false,"fork":false,"pushed_at":"2022-12-08T05:15:08.000Z","size":1063,"stargazers_count":27,"open_issues_count":23,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-30T11:03:43.881Z","etag":null,"topics":["api","charity","data","graphql"],"latest_commit_sha":null,"homepage":"https://charitybase.uk/api-portal","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charity-base.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-30T15:28:12.000Z","updated_at":"2024-01-12T02:03:59.000Z","dependencies_parsed_at":"2023-01-11T20:19:14.500Z","dependency_job_id":null,"html_url":"https://github.com/charity-base/charity-base-api","commit_stats":null,"previous_names":["tithebarn/charity-base"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charity-base%2Fcharity-base-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charity-base%2Fcharity-base-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charity-base%2Fcharity-base-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charity-base%2Fcharity-base-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charity-base","download_url":"https://codeload.github.com/charity-base/charity-base-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252439453,"owners_count":21748007,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","charity","data","graphql"],"created_at":"2024-08-02T21:00:32.319Z","updated_at":"2025-05-05T04:30:53.524Z","avatar_url":"https://github.com/charity-base.png","language":"JavaScript","funding_links":[],"categories":["Awesome tech for good projects"],"sub_categories":[],"readme":"# CharityBase GraphQL API\n\n- [Using the API](#using-the-api)\n  - [Playground](#playground)\n  - [Endpoint](#endpoint)\n  - [Versioning](#versioning)\n  - [Authorization](#authorization)\n  - [Response](#response)\n- [Working on the API](#working-on-the-api)\n  - [Installing](#installing)\n  - [Developing](#developing)\n  - [Deploying](#deploying)\n    - [Prod Environment Variables](#prod-environment-variables)\n\n## Using the API\n\n### Playground\n\nFor testing queries and viewing the interactive docs, use the [GraphiQL interface](https://charitybase.uk/api-explorer).\n\n### Endpoint\n\nThe API has a single endpoint:\n\n```\nhttps://charitybase.uk/api/graphql\n```\n\nAs described in the [GraphQL docs](https://graphql.org/learn/serving-over-http/) 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`).\n\n### Versioning\n\nThe API is versionless - we won't introduce any breaking changes. [What?!](https://graphql.org/learn/best-practices/#versioning)\n\n### Authorization\n\nWhether using `GET` or `POST`, send your API key in an Authorization header like so:\n\n```json\n\"Authorization\": \"Apikey 9447fa04-c15b-40e6-92b6-30307deeb5d1\"\n```\n\nReplace the above key with your own (available from the [API Portal](https://charitybase.uk/api-portal)) and be sure to keep the `Apikey` prefix as above.\n\n### Response\n\nA JSON body response is returned of the form:\n\n```js\n{\n  \"data\": { ... }, // not present if the request query was badly formed\n  \"errors\": [ ... ] // not present if there were no errors\n}\n```\n\nThe 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`.\n\nConveniently the `data` object has the same shape as the query sent in the request.\n\n## Working on the API\n\n### Installing\n\n```bash\nyarn # or npm install\ncp .env-example .env # then update variables in .env\n```\n\nNote: variables already in your environment (e.g. in `.bash_profile`) will override those in .env\n\n### Developing\n\n```bash\nyarn dev\n```\n\n### Deploying\n\n```bash\nyarn deploy:production\n```\n\nNote: this requires [Now](https://zeit.co/now) which can be installed globally with npm: `npm i -g now`\n\n#### Prod Environment Variables\n\nTo ensure our sensitive environment variables are only accessible by the API code, we store them as [Now secrets](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets/). This is achieved on the command line:\n\n```bash\nnow secret add charity-base-es-aws-access-key-id example-key-id\nnow secret add charity-base-es-aws-secret-access-key example-secret-key\n...\n```\n\nThe environment variable names are mapped to the secret names in `env` in [now.json](./now.json). Note the `@` prefixing each secret name.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharity-base%2Fcharity-base-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharity-base%2Fcharity-base-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharity-base%2Fcharity-base-api/lists"}