import requests
API_KEY = "YOUR_KEY"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Plain text — easiest to inject into LLM context
r = requests.get(
"https://senlay.world/api/v1/sense",
headers=headers,
params={"lat": 36.01, "lng": -5.60}
)
print(r.text)
# Or full JSON with all sensor data
r = requests.get(
"https://senlay.world/api/v1/pwm",
headers=headers,
params={"lat": 36.01, "lng": -5.60}
)
data = r.json()
print(data["context_string"])
const API_KEY = "YOUR_KEY";
// Plain text — drop straight into your prompt
const res = await fetch(
"https://senlay.world/api/v1/sense?lat=36.01&lng=-5.60",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
);
const sensoryContext = await res.text();
console.log(sensoryContext);
// Or full JSON
const json = await fetch(
"https://senlay.world/api/v1/pwm?lat=36.01&lng=-5.60",
{ headers: { Authorization: `Bearer ${API_KEY}` } }
).then(r => r.json());
console.log(json.context_string);