TrailAPI

GRATIS CON POSSIBILITÀ DI UPGRADE
Da trailapi | Aggiornamento 4 days ago | Travel
Popolarità

9.3 / 10

Latenza

1,073ms

Livello di servizio

100%

Health Check

N/A

Torna a tutte le discussioni

Internal Server Erorr; Status: 500

Rapid account: Exo
exo
a year ago
Hello - I'm trying to connect to the api but the javascript fetch function returns an internal server error code 500. Can you we verify the state of the TrailAPI before I continue?
```
API Response : 
index.html:34    
    
   GET https://trailapi-trailapi.p.rapidapi.com/trails/explore/?lat=39.7551&lon=-75.5291 500

(anonymous) @ index.html:34
index.html:36 {code: ‘internal_server_error’, message: ‘<p>There has been a critical error on this website…arn more about troubleshooting WordPress.</a></p>’, data: {…}, additional_errors: Array(0)}additional_errors: []code: "internal_server_error"data: {status: 500}message: “<p>There has been a critical error on this website.</p><p><a href=“https://wordpress.org/support/article/faq-troubleshooting/”>Learn more about troubleshooting WordPress.</a></p>”[[Prototype]]: Object

---------------------------------------------------------------------------------------------------
My <script> block: 
```	<script>
function getInputValue() {
	var inputVal = document.getElementById("searchText").value;
	console.log(inputVal)
}
var lat;
var long;
document.getElementById("search").addEventListener("click", ()=> {
	navigator.geolocation.getCurrentPosition((position) => {
		let lat = position.coords.latitude;
		let long = position.coords.longitude;

		console.log(lat + "," + long);
	
const options = {
	method: 'GET',
	headers: {
		'X-RapidAPI-Key': '06c6d67a50mshe8ad2b792c799e9p150051jsn9808f6b7a8df',
		'X-RapidAPI-Host': 'trailapi-trailapi.p.rapidapi.com'
	}
};

fetch('https://trailapi-trailapi.p.rapidapi.com/trails/explore/?lat=39.7551&lon=-75.5291', options)
	.then(response => response.json())
	.then(response => console.log(response))
	//.catch(err, console.error(error));

});
})


	</script>
	```
Any help is greatly appreciated; thank you.
Rapid account: Trailapi
trailapi Commented a year ago

Hi there, thanks for the note. This should be working now, please let us know if not.

Cheers!

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti