Bikologi Aurora

The Bikologi Framework and API Documentation.

API

The Bikologi API is your gateway to accessing component, bike, and other data relevant to your application. We provide two ways to access the API. 1. Methods used to access data are based on the Fetch API, with polyfills for older browsers. 2. The endpoints for server side and other integrations.

API Key

In order to access the API, you will need an API key. If you haven't received a key and are expecting one, please contact an administrator. Your key is sent over in the authorization header. If you're using our API, pass your key as the last parameter in the function.

{Authorization : abc123}

Fetch API

We believe the Fetch API is going to be the best native way to integrate with APIs from the browser. Each one of our methods to access components or products is built off the Fetch API(you can always use whatever HTTP client you'd like, query strings are the same) and has been tested back to IE10.

To include the Bikologi framework on your site, include<script src="http://docs.bikologi.com/bikologi-aurora.min.js"></script> in the head section of your page.

//example request
var Bikologi = window.Bikologi,
	query = { 
		component: 'fork', //we want forks
		maxForkTravel: 170, //that are 170mm or less travel
		minForkTravel: 150, //that are 150mm or greater travel
		rearAxleSize: '12 x 148', //that will fit a 12 x 148 bike, returning boost forks
		wheelSize: '27.5' //that fit 27.5" bikes
	},
	apiKey = 'abc123';

Bikologi.componentAPI(query, apiKey)
	.then(function(resp){ 
		console.log(resp)
	}).catch(function(err) {
		console.log(err);
	});
			
// example response
[{
	"_id": "5677a85fba0c720c002a0cb0",
	"component": "fork",
	"category": "suspension",
	"year": 2016,
	"manufacturer": "Rock Shox",
	"model": "Pike RCT3",
	"wheelSize": "27.5",
	"steererTube": "1.125 x 1.5",
	"images": {
		"ad": [],
		"builder": [{
			"use": "builder",
			"render": "desktop",
			"url": "http://content.bikologi.com/component/2016/rock-shox/fork/pike-rct3-fork-steerer-desktop.png",
			"position": "steerer",
			"color": "fork"
		},{
			"use": "builder",
			"render": "desktop",
			"url": "http://content.bikologi.com/component/2016/rock-shox/fork/pike-rct3-white-desktop.png",
			"color": "white"
		},{
			"use": "builder",
			"render": "desktop",
			"url": "http://content.bikologi.com/component/2016/rock-shox/fork/pike-rct3-black-brake-mount-desktop.png",
			"position": "brake-mount",
			"color": "black"
		}],
		"vanity": [{
			"use": "vanity",
			"render": "desktop",
			"url": "http://content.bikologi.com/component/2016/rock-shox/fork/pike-rct3-black-desktop.jpg",
			"color": "black"
  		},{
			"use": "vanity",
			"render": "desktop",
			"url": "http://content.bikologi.com/component/2016/rock-shox/fork/pike-rct3-white-desktop.jpg",
			"color": "white"
		}]
	},
	"__v": 0,
	"weight": 1861,
	"msrp": 1050,
	"enabled": true,
	"pricing": { // affiliate pricing info to be removed },
	"description": "//affiliate description to be removed",
	"hubBody": [],
	"rearAxleSize": [],
	"frontAxleSize": [
		"15 x 100",
		"15 x 110"
	],
	"seatpostDiameter": [],
	"crankArmLength": [],
	"speeds": [],
	"shockSize": [],
	"travel": [
		"120",
		"130",
		"140",
		"150",
		"160"
	],
	"usage": [
		"trail",
		"enduro"
    ]
}]
			

API End Points

We utilize Heroku for our hosting, and are currently using their SSL for HTTPS. The component API can be accessed here:

GET* https://bikologi-api.herokuapp.com/component Returns products in array
POST https://bikologi-api.herokuapp.com/component Adds product to approval queue.

*Note that we don't recommend this actual GET request, as the payload can be > 2mb.

Components

var query = { 
	manufacturer : 'sram',
	model : 'eagle',
	year : 2017
};

Bikologi.componentAPI(query, apiKey)
	.then(function(resp){ 
		console.log(resp)
	}).catch(function(err) {
		console.log(err);
	});
			
GET https://bikologi-api.herokuapp.com/component Returns components in an array
Key Type Value Requirements
manufacturer string see brands api optional. gets components by brand. note, uses regex
year integer 2015, 2016, 2017, 2018 optional, manufacturer / model are required to work. gets components from a year
model string 'eagle', 'xx1', '36', 'hsc', 'pike rct3 debonair' optional, manufacturer / year required to work. gets components by model. note, uses regex. 'eagle' will return multiple results.

Forks - All

//returns all forks
var query = { 
	component: 'fork' //we want forks
};
			
GET https://bikologi-api.herokuapp.com/component?component=fork Returns all forks in array

Forks - Detailed

All paramaters that are possible to return a specific subset of forks.

//returns specific forks
var query = { 
	component: 'fork', //we want forks
	maxForkTravel: 170, //that are 170mm or less travel
	minForkTravel: 150, //that are 150mm or greater travel
	rearAxleSize: '12 x 148', //that will fit a 12 x 148 bike, returning boost forks
	wheelSize: '27.5' //that fit 27.5" bikes
};
			
GET https://bikologi-api.herokuapp.com/component?component=fork&maxForkTravel=180&minForkTravel=150&rearAxleSize=12 x 148&wheelSize=27.5 Returns available forks in array
Key Type Value Requirements
minForkTravel integer 100 required with maxForkTravel
maxForkTravel integer 203 required with minForkTravel
wheelSize string "27.5", "29" 26, one day
rearAxleSize string "12 x 148" currently only one option to get boost forks

Shocks - All

var query = { 
	component: 'shock' //we want shocks
};
			
GET https://bikologi-api.herokuapp.com/component?component=shock Returns all shocks in an array

Shocks - By Size

var query = { 
	component: 'shock', //we want shocks
	shockSize: '8.5 X 2.5' //that fit a Wreckoning
};
			
GET https://bikologi-api.herokuapp.com/component?component=shock&shockSize=8.5 x 2.5 Returns all shocks in an array
Key Type Value Requirements
shockSize string Imperial:
"5.5 x 1", "6 x 1.25", "7.25 x 1.75", "7.5 x 2", "7.875 x 2", "7.875 x 2.25", "8.25 x 2.375", "8.5 x 2.25", "8.5 x 2.5", "8.75 x 2.75", "9.5 x 3", "10.5 x 3.5"

Metric:
"210 x 52.5", "230 x 65", "230 x 57.5"
optional

Wheels - All

var query = { 
	component: 'wheel set', //we want wheels
};
			
GET https://bikologi-api.herokuapp.com/component?component=wheel set Returns all wheel sets in an array

Wheels - By Size / Axle

There isn't an option for frontAxleSize. The wheelset returns what axle options are available for the fork. This will be revisited in the wheel builder.

var query = { 
	component: 'wheel set', //we want wheels
	wheelSize: '27.5+', //plus size
	rearAxleSize: '12 x 148' //boost baby
};
			
GET https://bikologi-api.herokuapp.com/component?component=wheel set&wheelSize=27.5%2B&rearAxleSize=12 x 148 Returns all wheel sets in an array
Key Type Value Requirements
rearAxleSize string "5 x 135", "10 x 135", "12 x 135", "12 x 142", "12 x 148", "12 x 150", "12 x 157" optional
wheelSize string "27.5", "29", "27.5+" (27.5%2B, remember to encode certain special characters in the query string) optional

Tires - All

var query = { 
	component: 'tires', //we want tires
};
			
GET https://bikologi-api.herokuapp.com/component?component=tires Returns all tires in an array

Tires - By Size / Width

var query = { 
	component: 'tires', //we want tires
	usage: 'enduro', //enduro
	wheelSize: '27.5', //650b
	maxTireSize : 2.6 //less than 2.6" wide
};
			
GET https://bikologi-api.herokuapp.com/component?component=tires&usage=enduro&wheelSize=27.5&maxTireSize=2.6 Returns selected tires in an array
Key Type Value Requirements
usage string "hardtail", "cross country", "trail", "enduro", "downhill" optional, probably not the most reliable
wheelSize string "27.5", "29", "27.5+" (27.5%2B, remember to encode special characters in the query string) optional
maxTireSize int 2.1 - 3.0 optional

Drivetrain - By Speeds

How to access derailleurs, shifters, and cassettes.

var query = { 
	component: 'drivetrain', //we want drivetrain parts
	speeds : ['1 x 11', '1 x 12'] //i like big cassettes and i can not lie
};
			
GET https://bikologi-api.herokuapp.com/component?component=drivetrain&speeds=1 x 11&speeds=1 x 12 Returns selected drivetrain components in an array
Key Type Value Requirements
speeds array or string "1 x 7", "1 x 10", "1 x 11", "1 x 12" required, at least one. 1 x 7 and 1 x 10 are currently dh drivetrains

Chain Guides

var query = { 
	component: 'chain guide', //we want guides
	iscg : 'iscg-05' //iscg-05, who uses anything else?
};
			
GET https://bikologi-api.herokuapp.com/component?component=chain guide&iscg=iscg-05 Returns all chain guides
Key Type Value Requirements
iscg array or string "iscg-05" optional. all guides are currently iscg-05.

Chain Rings - All

var query = { 
	component: 'chain ring', //we want rings
};
			
GET https://bikologi-api.herokuapp.com/component?component=chain ring Returns all chain rings in an array

Cranksets - All

var query = { 
	component: 'crankset', //we want crank
};
			
GET https://bikologi-api.herokuapp.com/component?component=crankset Returns all chain rings in an array
Key Type Value Requirements
usage string "enduro", "trail", "cross country", "hardtail", "downhill" optional. really just used to separate downhill from others

Bottom Brackets - All

var query = { 
	component: 'bottom bracket', //we want bbs
};
			
GET https://bikologi-api.herokuapp.com/component?component=bottom bracket Returns all bottom brackets

Bottom Brackets - By Size

var query = { 
	component: 'bottom bracket', //we want bbs
	bottomBracket : 'bsa-68' //that are english threaded 68/73
};
			
GET https://bikologi-api.herokuapp.com/component?component=bottom bracket&bottomBracket=bsa-68 Returns selected bottom brackets in an array
Key Type Value Requirements
bottomBracket string "bsa-68", "bsa-83", "pf30", "pf30-83", "bb30", "bb90", "bb91", "bb92", "bb107" optional. used when you pass frame size bb to get appropriate bbs.

Seatposts - All

var query = { 
	component: 'seatpost', //we want posts
};
			
GET https://bikologi-api.herokuapp.com/component?component=seatpost Returns all seat posts in an array

Seatposts - By Diameter

var query = { 
	component: 'seatpost', //we want posts
	seatpost: 34.9 //that fit a wreckoning
};
			
GET https://bikologi-api.herokuapp.com/component?component=seatpost&seatpost=34.9 Returns appropriate seat posts in an array
Key Type Value Requirements
seatpost string 28.2, 30.9, 31.6, 34.9 optional. used when you pass frame seat post size.

Saddles - All

var query = { 
	component: 'saddles', //we want saddles
};
			
GET https://bikologi-api.herokuapp.com/component?component=saddles Returns all saddles in an array

Pedals - All

var query = { 
	component: 'pedals', //we want pedals
};
			
GET https://bikologi-api.herokuapp.com/component?component=pedals Returns all pedals in an array

Handlebar - All

var query = { 
	component: 'handlebar', //we want bars
};
			
GET https://bikologi-api.herokuapp.com/component?component=handlebar Returns all bars in an array

Grips - All

var query = { 
	component: 'grips', //we want grips
};
			
GET https://bikologi-api.herokuapp.com/component?component=grips Returns all grips in an array

Stem - All

var query = { 
	component: 'stem', //we want stems
};
			
GET https://bikologi-api.herokuapp.com/component?component=stems Returns all stems in an array

Stem - By Mount

var query = { 
	component: 'stem', //we want stems
	stemDirectMount: true
};
			
GET https://bikologi-api.herokuapp.com/component?component=stems&stemDirectMount=true Returns appropriate stems in an array
Key Type Value Requirements
stemDirectMount bool true optional. used for dh stems.

Headsets - All

var query = { 
	component: 'headset', //we want cups
};
			
GET https://bikologi-api.herokuapp.com/component?component=headset Returns all headsets in an array

Headsets - By SHIS

//specific
var query = { 
	component: 'headset', //we want cups
	shisUpperSize: 44, //44mm 
	shisUpperType:'ZS, //Zero Stack Upper
	shisLowerSize:49, //49mm
	shisLowerType: 'EC' //External Cup Lower
};

//generic
var query = { 
	component: 'headset', //we want cups
	shisUpperType:'ZS, //Zero Stack
};
			
GET https://bikologi-api.herokuapp.com/component?component=headset Returns appropriate headsets in an array
Key Type Value Requirements
shisUpperSize string "34", "44", "49", "56", "IS41", "IS42", "IS47", "IS52", "knockblock" optional. used to match headsets to frames
shisUpperType string "EC", "ZS", "IS", "knockblock" optional. used to match headsets to frames
shisLowerSize string "34", "44", "49", "56", "IS41", "IS42", "IS47", "IS52", "knockblock" optional. used to match headsets to frames
shisLowerType string "EC", "ZS", "IS", "knockblock" optional. used to match headsets to frames

Brakes - All

var query = { 
	component: 'brake', //we want brakes
};
			
GET https://bikologi-api.herokuapp.com/component?component=brake Returns all brakes in an array
Key Type Value Requirements
usage string "enduro", "trail", "cross country", "hardtail", "downhill" optional. really just used to separate downhill from others

Rotor - All

var query = { 
	component: 'rotor', //we want rotors
};
			
GET https://bikologi-api.herokuapp.com/component?component=rotor Returns all rotors in an array

Bikes

Bikes - All

var query = { 
	manufacturer : 'yt',
	model : 'tues',
	year : 2017
};

Bikologi.bikeAPI(query, apiKey)
	.then(function(resp){ 
		console.log(resp)
	}).catch(function(err) {
		console.log(err);
	});
			
GET https://bikologi-api.herokuapp.com/bike Returns bikes in an array
Key Type Value Requirements
manufacturer string see brands api optional. gets bikes of brand. note, uses regex.
year integer 2015, 2016, 2017, 2018 optional. gets bikes from a year
model string following, insurgent, wreckoning, slash, etc optional. gets bike by mode. note, uses regex. 'patrol' will return multiple results.

Brands - All

Bikologi.brandAPI(apiKey)
	.then(function(resp){ 
		console.log(resp)
	}).catch(function(err) {
		console.log(err);
	});
				
GET https://bikologi-api.herokuapp.com/manufacturer Returns brands in an array

Component Compatibility

Initial compatibility will happen by properly calling the components according to parameters returned from calling the bike API. However, there are plenty of scenarios of compatibility checks that will have to happen after initial product requests.

MTB Image Generator

The premise of utilizing the Product API comes to fruition with the image generator. Looking at each of the objects returned from the api, each uses the _id property. We utilize the _id as a unique id for each component and bike. We combine this with a server side image rendering approach. Let's take a look at this example url:

<img src="https://bikologi-stage-images.herokuapp.com/trail-bike.png?bikeID=59501e1cdcead9000f037301
	&bikeColor=tan
	&forkID=595032e5dcead9000f037339
	&wheelsID=582eb29949123b00105a5d50
	&wheelsColor=yellow
	&frontTireID=5903eff06c1d51000fa150fd
	&rearTireID=5903eff06c1d51000fa150fd" />
			

DH / Trail Bike Parameters

To render a trail, enduro, xc, or hardtail mountain bike, use the following(temporary) URL: https://bikologi-stage-images.herokuapp.com/trail-bike.png?bikeID=...

To render a DH bike, use the following(temporary) URL: https://bikologi-stage-images.herokuapp.com/dh-bike.png?bikeID=...

bikeID* _id of bike. Required. bikeColor Defaults to first in array of colors on object. cockpitID Any value triggers cables on frame.
forkID _id of component. forkColor Defaults to first in array of colors on object.
shockID _id of component. shockColor Defaults to first in array of colors on object.
wheelsID _id of component. wheelsColor Defaults to first in array of colors on object.
frontTireID _id of component. frontTireColor Defaults to first in array of colors on object.
rearTireID _id of component. rearTireColor Defaults to first in array of colors on object.
rearDerailleurID _id of component. rearDerailleurColor Defaults to first in array of colors on object.
cassetteID _id of component. cassetteColor Defaults to first in array of colors on object.
chainID _id of component. chainColor Defaults to first in array of colors on object.
chainRingID _id of component. chainRingColor Defaults to first in array of colors on object.
spiderID _id of component. spiderColor Defaults to first in array of colors on object.
cranksetID _id of component. cranksetColor Defaults to first in array of colors on object.
shifterID _id of component. shifterColor Defaults to first in array of colors on object.
bottomBracketID _id of component. bottomBracketColor Defaults to first in array of colors on object.
chainGuideID _id of component. chainGuideColor Defaults to first in array of colors on object.
headsetID _id of component. headsetColor Defaults to first in array of colors on object.
seatPostID _id of component. seatPostColor Defaults to first in array of colors on object.
saddleID _id of component. saddleColor Defaults to first in array of colors on object.
handlebarID _id of component. handlebarColor Defaults to first in array of colors on object.
gripID _id of component. gripColor Defaults to first in array of colors on object.
stemID _id of component. stemColor Defaults to first in array of colors on object.
brakeID _id of component. Triggers brake mount image. brakeColor Defaults to first in array of colors on object.
rotorID _id of component. rotorColor Defaults to first in array of colors on object.
pedalID _id of component. pedalColor Defaults to first in array of colors on object.

MTB Query String Generator

With a valid API key, you can use this form to generate an image, or get a better understanding how to. Note that there is no compatibility logic. This is purely for an example. Compatibility logic will be provided as a seperate layer on production applications.