Merge "Document how to get a Blue Alliance API key for scouting"
diff --git a/scouting/README.md b/scouting/README.md
index 39e1146..6e31b5b 100644
--- a/scouting/README.md
+++ b/scouting/README.md
@@ -73,3 +73,54 @@
configuration.
You can then visit <https://localhost:3456/> to look at the webserver.
+
+Getting data from thebluealliance.com
+--------------------------------------------------------------------------------
+We get a few pieces of information from The Blue Alliance:
+* the match schedule, and
+* the team rankings.
+
+For this to work, you need to set up a config file that contains your API key
+for The Blue Alliance. Follow these steps if you want to get data from The Blue
+Alliance.
+
+1. Make an account on <www.thebluealliance.com>. If helpful, you can use your
+ Google account or Apple account to log in.
+2. On the Account page, scroll down to the "Read API Keys" section.
+3. Enter something like "scouting app" in the "Description" field and click the
+ "Add New Key" button.
+4. Scroll back down to the "Read API Keys" section.
+5. Copy the X-TBA-Auth-Key in the table. It looks like a long string of random
+ characters and numbers.
+
+Now that you have your API key, create a config file called
+`scouting_config.json` in the root of the 971-Robot-Code repo. It should have
+the following contents:
+```json
+{
+ "api_key": "<api key>"
+}
+```
+where `<api key>` needs to be replaced by the key you copied from your Account
+page on <www.thebluealliance.com>.
+
+When running the webserver, add the `-tba_config` option, specifying the
+absolute path of the config file.
+
+```console
+$ bazel run //scouting -- ... --tba_config=$PWD/scouting_config.json
+```
+
+### Scraping ranking data
+In order to scrape ranking data, add the competition-specific information to
+`scouting_config.json`. It should look like this:
+```json
+{
+ "api_key": "<api key>",
+ "year": <year>,
+ "event_code": "<event code>",
+}
+```
+where `<year>` is the year of the event and `<event_code>` is the short code
+for the event. A list of event codes is available
+[here](http://frclinks.com/#eventcodes).