Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Winston Quin
Winston Quin
10,359 Points

Why does my API key only work when I remove the carrots from the API key between double quotes in the JSON?

I was stuck on this video for a long time because in my JSON file the API key value pair looked like this:

JSON
{
    "key": "<fdeacae128cda394>"
}

Nothing was mentioned in the video, but it looked to me like Andrew's example used carrots. I was thinking maybe it was a special syntax for API keys:

JSON
{
    "key": "<API KEY>"
}

I'm using the same API but mine only works when I remove the carrots from the key value pair in the JSON file, like so (thanks for the info about including code in questions).

JSON
{
    "key": "fdeacae128cda394"
}

When I removed the carrots everything started to work. It's taken me several days of watching and rewatching this video to even get a clue what was going wrong.

I think I understand now what was happening. He was putting his placeholder value inside carrots. Is this a common syntax for placeholder values in JSON?

Adam Beer
Adam Beer
11,314 Points

Please show your code. It's hard to guess

Code

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

      ```html
      <p>This is code!</p>
      ```

2 Answers

Alexander Solberg
Alexander Solberg
14,350 Points

By "carrots", are you referring to the the tags(<, >)? English is not my native tongue so I'm not quite sure :P

Anyways, it's only there to indicate where to place your actual data. I have seen the same type of indication when reading through documentation on Heroku and mLab.