Support Center

Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

API call not returning JSON

Alan Charles Mar 08, 2019 06:12PM GMT


this might be really stupid but I keep getting the following error when trying to make the api call in my React app.

Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

my api call is relatively simple:

export const fetchWeather = async () => {
const url = `${weatherKey}`;

const response = await fetch(url);
const weatherData = await response.json();


when i try it in postman i get the response I'm looking for :

"coord": {
"lon": -75.58,
"lat": 41.96
"weather": [
"id": 500,
"main": "Rain",
"description": "light rain",
"icon": "10d"
"id": 600,
"main": "Snow",
"description": "light snow",
"icon": "13d"
"base": "stations",
"main": {
"temp": 272.3,
"pressure": 957,
"humidity": 46,
"temp_min": 269.26,
"temp_max": 274.82

Up 0 rated Down
Germán Jul 30, 2019 11:01PM BST
Me too!!!! u can fix it?

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found