i want to fetch specific information from an API that i got,
the problem is that when i do that i am limited to 100lists or something from the API and i don't know how to look further..
my code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<script>
const api_url =
"https://data.gov.il/api/3/action/datastore_search?resource_id=8a21d39d-91e3-40db-aca1-f73f7ab1df69";
async function getData() {
const response = await fetch(api_url);
const data = await response.json();
console.log(data.result.records);
}
getData();
//fetch('https://data.gov.il/api/3/action/datastore_search?resource_id=8a21d39d-91e3-40db-aca1-f73f7ab1df69', {
// method: 'GET',
// headers: {
// 'Content-Type': 'application/json'
// },
// body: JSON.stringify({
//
// })
//})
// .then(res => {
// if (res.ok){
// console.log('success')
// } else{
// console.log('not success')
// }
// })
// .then(data => console.log(data))
</script>
</body>
</html>
there is two methods there that i tried, they basically work the same..
when i go to data results records i can see the arrays with the information, i know how to access one of them for example, but all of it is about 1 city, i want to access more cities(on City_name).
is it even possible? or the API is limited to this 100 arrays
question from:
https://stackoverflow.com/questions/65951490/fetch-specific-information-from-api-in-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…