{"id":18878575,"url":"https://github.com/verida/network-data-api","last_synced_at":"2026-02-19T17:30:16.581Z","repository":{"id":157965418,"uuid":"610230755","full_name":"verida/network-data-api","owner":"verida","description":"An API that returns public data from the Verida network","archived":false,"fork":false,"pushed_at":"2024-08-02T07:36:34.000Z","size":224,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-12-31T02:42:12.542Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/verida.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T11:06:34.000Z","updated_at":"2024-08-02T07:36:38.000Z","dependencies_parsed_at":"2024-08-02T09:06:49.816Z","dependency_job_id":null,"html_url":"https://github.com/verida/network-data-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fnetwork-data-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fnetwork-data-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fnetwork-data-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verida%2Fnetwork-data-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verida","download_url":"https://codeload.github.com/verida/network-data-api/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239841731,"owners_count":19705981,"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":[],"created_at":"2024-11-08T06:28:10.330Z","updated_at":"2026-02-19T17:30:16.515Z","avatar_url":"https://github.com/verida.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Verida Network Data API\n\nhttps://github.com/verida/network-data-api\n\nThis is a generic API that fetches public data from the Verida network. It also supports fetching IPFS records uploaded via Moralis.\n\nThis server is hosted publicly at: [https://data.verida.network](https://data.verida.network)\n\n## Installation instructions\n\n### Set up environment\n\n```sh\ncp .env.example .env\n```\n\n**`.env` File contains**\n\n- ENABLED_REDIS_CACHE -\u003e Enable Redis cache\n- SERVER_PORT -\u003e Optional, defaults to 8182\n- REDIS_HOST -\u003e hostname of the Redis server\n- REDIS_PORT -\u003e port of the r=Redis server\n- CACHE_DATA_TIMEOUT_SECONDS -\u003e Timeout for cache data entries\n\n### Local Redis\n\nUsing Docker:\n\n```sh\ndocker run -d --name redis-stack -p 6379:6379 -p 8001:8001 redis/redis-stack:latest\n```\n\nYou can inspect the Redis cache:\n\n```sh\n\u003e docker restart redis-stack # if needed\n\u003e docker ps # get the container ID\n\u003e docker exec -it \u003ccontainer id\u003e /bin/sh  # get a shell\n\u003e redis-cli # start the the redis cli\n```\n\nTo clear all the caches get the redis-cli (as above) and then:\n\n```sh\nflushdb\n```\n\n## Running the server\n\n```sh\nyarn install\nyarn run dev\n```\n\n## Run serverless offline\n\n```sh\nyarn svl-offline\n```\n\n## Deployment\n\nAs a Lambda (but see https://github.com/verida/network-data-api/issues/6#issue-1696826403):\n\n```\nnvm use\nexport AWS_PROFILE=verida-original\nyarn deploy-prod\n```\n\n## Usage\n\nMake HTTP GET requests to fetch data from the network in the following format:\n\n```\nhttps://localhost:8182/\u003cnetwork\u003e/\u003cdid\u003e/\u003ccontextName\u003e/\u003cdatabaseName\u003e/\u003crecordId\u003e/\u003cattribute\u003e/\u003c...deepAttributes\u003e\n```\n\n`did`, `contextName`, `databaseName` and `recordId` are required. The rest are optional.\n\nIf an `attribute` is specified, just that attribute value from the record is returned.\n\n### Deep attributes\n\n`deepAttributes` represent an unlimited number of levels that can be retrevied with in a JSON result.\n\nAssume there is a record with the following data:\n\n```\n{\n    _id: 'test-record',\n    data: {\n        name: {\n            firstName: 'steve',\n            lastName: 'jones'\n        }\n    }\n}\n```\n\nIt's possible to fetch just `lastName` with:\n\n```\n/\u003cdid\u003e/\u003cnetwork\u003e/\u003ccontextName\u003e/\u003cdatabaseName\u003e/test-record/data/name/lastName\n```\n\n### Network stats\n\nIt's possible to load the stats for a particular network:\n\n```\n/network/banksia/stats\n```\n\n### Network DIDs\n\nIt's possible to load a list of DIDs from network.\n\nList the DIDs created from 21-30:\n\n```\n/network/polpos/dids?limit=10\u0026offset=20\n```\n\nList the most recent 20 DIDs created:\n\n```\n/network/polamoy/dids?limit=20\u0026order=-1\n```\n\n## Examples\n\n### Fetch a record\n\nFetch a user's public profile:\n\n```\n/did:vda:polamoy:0x84746Ff2bC4E998fB23815f242d192912076e767/banksia/Verida:%20Vault/profile_public/basicProfile\n```\n\nThis returns the full record with `_id=basicProfile`\n\n```json\n{\n  \"_id\": \"basicProfile\",\n  \"_rev\": \"13-402d249600cfe3984a6a90e459d348dc\",\n  \"avatar\": { \"uri\": \"data:image/undefined;base64,/9j/4A....\u003ctruncated\u003e\" },\n  \"country\": \"Australia\",\n  \"description\": \"Help building user-centric and privacy-preserving applications with Verida\",\n  \"modifiedAt\": \"2023-03-03T04:50:32.227Z\",\n  \"name\": \"Aurel\",\n  \"schema\": \"https://common.schemas.verida.io/profile/basicProfile/v0.1.0/schema.json\",\n  \"signatures\": {\n    \"did:vda:polamoy:0x84746ff2bc4e998fb23815f242d192912076e767?context=0x3c51af440094f5e93e3421504b8203228804ea2bbcfb11a2790d25e5f8898f01\": \"0x4d173694cf32990e7fcea45b46da5f6b9af507a2ffc3904b3c71bf1a87817f7f671b55bc820c17a68384467039dddda4aaa5fada898fb91c0013fe44daf934ab1b\"\n  }\n}\n```\n\n### Fetch the attribute for a record\n\nFetch a user's public profile avatar:\n\n```\n/did:vda:polamoy:0x84746Ff2bC4E998fB23815f242d192912076e767/banksia/Verida:%20Vault/profile_public/basicProfile/avatar\n```\n\nThis returns just the `avatar` attribute from the public profile record:\n\n```json\n{ \"avatar\": { \"uri\": \"data:image/undefined;base64,/9j/4A....\u003ctruncated\u003e\" } }\n```\n\n### Fetch a deep attribute for a record\n\n```\n/did:vda:polamoy:0x84746Ff2bC4E998fB23815f242d192912076e767/banksia/Verida:%20Vault/profile_public/basicProfile/avatar/uri\n```\n\nReturns just the `uri` part of the `avatar` attribute\n\n```json\n{ \"avatar\": { \"uri\": \"data:image/undefined;base64,/9j/4A....\u003ctruncated\u003e\" } }\n```\n\n### Fetch IFPS data\n\nhttps://data.verida.network/ipfs/QmezTsjRwoi5XoqYLCH6sz4RSjXDUMXWGGFrVDxZh19p9j\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverida%2Fnetwork-data-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverida%2Fnetwork-data-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverida%2Fnetwork-data-api/lists"}