active-activity-search
Active.com Activity Search v2 HTTP API client.
npm install active-activity-search --save
npm stats
Example
Initialize
var client = key: '******' url: 'https://api.amp.active.com/v2/search' // optional as this is the default url
Callback
client
Promise
client
Features
- Supports all documented API query parameters.
- Supports 12-factor configuration.
- Accepts a traditional node-style callback otherwise, returns a promise.
- Exposes a
User-Agent
request header including the name and version of the client. - Exposes a fluent interface.
- Emits debug logs via
DEBUG=active-activity-search*
.
12-factor configuration example
ACTIVE_ACTIVITY_API_KEY="*****"ACTIVE_ACTIVITY_API_URL="https://api.amp.active.com/v2/search" # optional as this is the default url
API
active([options])
Arguments
The following arguments can also be specified via environment variables.
[options]: (Object)
options object.[key]: (String)
API key.- or
process.env.ACTIVE_API_KEY
- or
[url]: (String)
API base URL.- or
process.env.ACTIVE_API_URL
- or
Returns
client: (Object)
API client object.
.options()
(read only)
Arguments
- n/a
Returns
options: (Object)
options object.
.set
Invoke corresponding accessor for each snake_cased parameter in given source object.
set({ show_suggest: true, query: 'running' })
NOTE: see http://developer.active.com/docs/read/v2_Activity_API_Search
Accessors
For each parameter a corresponding camelCased accessor (getter/setter) function is exposed.
- All accessors are chainable.
- Call accessor function w/o arguments and it will act as a getter.
- Call accessor function w/ an argument and it will act as a setter.
functions
- near
- latLon
- bbox
- geoPoints
- radius
- showDistance
- city
- state
- zip
- country
- query
- currentPage
- perPage
- sort
- facets
- facetValues
- category
- categoryName
- topic
- topicName
- metaInterest
- metaInterestName
- attributes
- tags
- startDate
- endDate
- cb
- excludeChildren
- includeEvergreenChildren
- registerableOnly
- exists
- notExists
- assetName
- orgId
- placeId
- sourceSystemId
- sourceSystemName
- showSuggest
- searchAgain
- fields
- assetGuid
- substitutionUrl
- authorName
- reqMinAge
- cityName
- topicName