NYC Space/Time Directory API
Search API powered by AWS Lambda and AWS Elasticsearch, Serverless and Express, for data from NYC Space/Time Directory.
Supported Endpoints
Single Object
- Endpoint:
/datasets/:datasetId/objects/:objectId
- Description: fetch single Object with given
:datasetId
and:objectId
- Example:
/datasets/addresses/objects/104981-1
Search
- Endpoint:
/search
- Description: search Objects by name, date, type or geometry
- Example:
/search?geometry=-73.9913698,40.7254308,-73.9913698,40.7254308&name=broadway&since=1900
- Parameters:
name
: Name of Object, or part of namegeometry
: coordinates of bounding box Object is contained by or intersects, in formnorth,west,south,east
types
: comma-separated list of types, e.g.st:Building,st:Address
since
: Object must be younger than this yearuntil
: Object must be older than this year
AWS Configuration
Prior to deployment, you must ensure your AWS_PROFILE
is set as an environment variable in your Lambda AWS Console Configuration page.
Development
Install Dependencies
First, install Serverless framework globally:
$ npm install -g serverless
Then, install dependencies:
$ npm install
Offline API Mode
$ sls offline start
Deploy to AWS Lambda
$ sls deploy