API
ข้อมูลคำตอบทางกฎหมายและข้อมูลสถานที่ที่ผ่านการตรวจสอบชุดเดียวกับที่ขับเคลื่อนเว็บไซต์นี้ พร้อมให้แอปพลิเคชันของท่านนำไปใช้งาน
การยืนยันตัวตน
ส่งคีย์ของท่านผ่าน header ชื่อ X-API-Key ในทุกคำขอ
curl -H "X-API-Key: camp_your_key_here" \
https://420.camp/api/v1/places?bbox=4.85,52.35,4.95,52.40คีย์จะแสดงให้เห็นเพียงครั้งเดียวตอนสร้าง และจะถูกจัดเก็บในรูปแบบ hash เท่านั้น หากทำคีย์หาย ให้เพิกถอนคีย์เดิมแล้วออกคีย์ใหม่
ขีดจำกัดอัตราการเรียกใช้งาน (Rate limits)
| แพ็กเกจ | คำขอ / นาที | รายการข้อมูล / วัน |
|---|---|---|
| Free | 10 | 1,000 |
| Pro | 60 | 10,000 |
| Network | 300 | 200,000 |
มีขีดจำกัดสองประเภท เนื่องจากหน้าข้อมูลขนาดใหญ่เพียงไม่กี่หน้าก็ใช้ข้อมูลมากเท่ากับหน้าข้อมูลขนาดเล็กหลายพันหน้า ทั้งสองขีดจำกัดจะรีเซ็ตแบบหน้าต่างเลื่อน (rolling window)
GET /places
Venues in an area. Give it a bounding box, a jurisdiction, or a point and radius.
bbox- west,south,east,north — the map viewport
jurisdictionId- all venues in a city, region or country
lat, lng, radiusKm- everything within a distance of a point
type- adult_use_dispensary, private_social_club, coffeeshop, pharmacy…
limit- up to 1000 with an area filter, 50 without
curl -H "X-API-Key: $KEY" \
"https://420.camp/api/v1/places?bbox=4.85,52.35,4.95,52.40&limit=50"GET /places/{slug}
One venue in full: address, hours, products, photos and its verification state.
curl -H "X-API-Key: $KEY" \
"https://420.camp/api/v1/places/wonderland-bangkok-bangkok"GET /places/search
Find a venue by name.
q- at least two characters
curl -H "X-API-Key: $KEY" \
"https://420.camp/api/v1/places/search?q=green%20house"GET /jurisdictions/{id}/legal-summary
What is legal here, in plain language — the answer behind every venue page.
locale- en, uk, es, nl, pl, de, it, th
curl -H "X-API-Key: $KEY" \
"https://420.camp/api/v1/jurisdictions/{id}/legal-summary?locale=de"POST /legal/evaluate
Ask one question about one place: may I buy, possess, consume here?
action- purchase, possession, public_consumption, tourist_access, medical_access…
jurisdictionId or lat/lng- where the question is being asked
locale- answer language
curl -X POST -H "X-API-Key: $KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "tourist_access",
"lat": 52.3702,
"lng": 4.8952,
"locale": "en"
}' \
https://420.camp/api/v1/legal/evaluateการใช้งานข้อมูล
- ข้อมูลทางกฎหมายมีการเปลี่ยนแปลงได้ ควรแสดงวันที่ที่เราตรวจสอบข้อมูลล่าสุด ซึ่งมีอยู่ในทุกคำตอบด้านกฎหมาย
- อย่านำเสนอข้อมูลของเราว่าเป็นความเห็นทางกฎหมาย ข้อมูลนี้เป็นเพียงบทสรุปด้วยภาษาที่เข้าใจง่ายพร้อมแหล่งอ้างอิง
- ควรแคชคำตอบไว้แทนการขอข้อมูลชุดเดิมซ้ำ เนื่องจากขีดจำกัดจำนวนรายการข้อมูลนับจากสิ่งที่ท่านร้องขอ
- ระบุแหล่งที่มาว่า 420.camp และใส่ลิงก์ย้อนกลับไปยังหน้าสถานที่หรือหน้ากฎหมายที่ท่านนำข้อมูลมาใช้
รับคีย์
สร้างคีย์ได้จากแดชบอร์ดของท่าน ระดับฟรีไม่จำเป็นต้องกรอกข้อมูลการชำระเงิน
สร้างคีย์