{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "84db37a7",
   "metadata": {},
   "outputs": [],
   "source": [
    "token = \"MLY|5785156608236334|6a23e43e7e4eea586120f184a01d3419\"\n",
    "secret = \"MLY|5785156608236334|2949ca79be712737b455c6d61a4939ce\"\n",
    "url = \"https://www.mapillary.com/connect?client_id=5785156608236334\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "62f70818",
   "metadata": {},
   "outputs": [],
   "source": [
    "import requests\n",
    "params = {\"access_token\":token,\n",
    "         \"fields\": \"id\",\n",
    "         \"bbox\" : \"12.967,55.597,13.008,55.607\" }\n",
    "\n",
    "d = requests.get(\"https://graph.mapillary.com/images\", params = params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "50bb0d9b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'id': '1383728082010917'}"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d.json()[\"data\"][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "58bd678d",
   "metadata": {},
   "outputs": [],
   "source": [
    "params = {\"access_token\":token, \n",
    "         \"fields\":\"thumb_original_url\"}\n",
    "d2 = requests.get(\"https://graph.mapillary.com/1383728082010917\",params =params )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "9c27d12e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'thumb_original_url': 'https://scontent-cph2-1.xx.fbcdn.net/m1/v/t6/An-Z8Jqq5Zkis6CBTRoXZkgVI1Qkt0EDkqwhuqQ4i-Bdd7TcE2Ym0LfaTMnymZDG3d52CX2xyjkRxy3LvOqCvoWUa1zzMsEbZWofJ6DPmDYcG-9TGGjxfdUa4PaZI5Xmg92fehk_Nvy6GUvfhhPAZQ?ccb=10-5&oh=00_AfDnSZv_061cmamzdweIIuE8b0I_DAV7lzM4QW0HUh9JMw&oe=640CA647&_nc_sid=122ab1',\n",
       " 'id': '1383728082010917'}"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "d2.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7fd4ccf6",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}