Personal Project
JSON(P) API for FreeCodeCamp profile and curriculum map. Built with Node, Express, Cheerio, and Request
Example
An example of this API in use is on the FreeCodeCamp project page.
Server Install:
- Do the following in a system with node & npm v6.9.4 :
1234git clone https://github.com/tkodev/fcc-profile-api.gitcd fcc-profile-api/releasenpm installnode server.js
Server Usage:
- Your installed api server is available at: http://localhost:80/fcc
- JSONP url, example: http://localhost:80/fcc?user=your_username&callback=test
- JSON url, example: http://localhost:80/fcc?user=your_username
- User and callback arguments are optional, example: http://localhost:80/
- I also host a server for public use (be fair!) at: http://api.tko.dev/fcc
- JSONP url, example: http://api.tko.dev/fcc?user=your_username&callback=
- JSON url, example: http://api.tko.dev/fcc?user=your_username
- User and callback arguments are optional, example: http://api.tko.dev/fcc
- HTTPS supported!
Data Structure:
- HINT: Don’t specify a username to see how the curriculum map is organized. (use a linter)
- Three keys in object returned:
_map
contains all map & profile data._deprecated
contains all challenges that could not be found in the current map. FreeCodeCamp may have refactored the challenge into a newer name._errors
is returned exclusively (only key) when there are errors. Post an issue if you encounter this.
- Data returned in map are objects nested in
_data
arrays (to keep order of its contents). Use version 0.5.0 for simple unordered json output- Order is important, and the alternative is to use extra json like
"_order" : 1
has downsides when parsing output.
- Order is important, and the alternative is to use extra json like
Example shortened output (HTTP code 200).
|
|
Example error output (HTTP code 500).
|
|