Skip to content

Instantly share code, notes, and snippets.

@landonf
Last active August 29, 2015 14:07
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save landonf/a108030fdbf8d8f20c00 to your computer and use it in GitHub Desktop.
Save landonf/a108030fdbf8d8f20c00 to your computer and use it in GitHub Desktop.
Data posted to Apple by Spotlight (Bulky JSON payloads have been reformatted for readability). Note the X-Apple-UserGuid -- this appears to remain constant across all requests.
POST /fb?key=andromeda HTTP/1.1
Host: api.smoot.apple.com
Content-Type: application/json
Accept-Charset: utf-8
Connection: keep-alive
X-Apple-ActionSignature: ArFF0Bupz4+n05DZ/5MjOYH6XbRrC98eRfE+8OzUT0wKAAABwAMAAAABAAABAO7FAuqnAwyvZFj4n1tcSQxl42hKlg/915t5zBgrff9a2axEBZXtPF2Tg0rdJIEJJ/r4sMinOShzj3lvY9LmX1ZS76JmJNM0WZLzpat3WBzTmsgwyWUGSwO1ZUCURtaYyd5GryXCOfKyC0EIy8g3ppLlRdg4NOfIH043t/x7dzXjSJnuFZxgjkNtXJjlZtpyhU/1aozZABRHLK6nnPu33ek59bQMDwtQGyPC/3+DBJeujZcVuZI6of22HaV2oVFLz3zXEfEAcfeL5WPLWinnmLN+RZIrONwRmy/64kYbrkDO3P00R96wW6LJBYe63d6vWCrXlWTQeL7DDtwaR29Q0lYAAAAQ7fKDT5fxlqnZiMWRl6sNlQAAAJ8BZJzusSpopU9YFrn8J9VG1D/Ve1QAAACGBQJ/jp+/zKfOoBgaJGgjxWW8VEHM8hOyIUG96CcnUgA2Aqfvvv9nzKjAU05WWJSzGq4jMw5xzBsDlj9oSpM9/8PEHAlDKz2v7hNR3TLlAkH/2GMJgF7ly7dnqPPG4fjEvoT7Pz/bEepVSsboPqm8ztaSvCYoC3xBbXEPPO5AjiH4jeDbKLI=
Accept: application/json
X-Apple-UserGuid: 267af341-df6c-4eed-5e78-a2b8a49a1d1f
User-Agent: (OS X 14A389) Spotlight/916
Content-Length: 5991
Accept-Encoding: gzip, deflate
Accept-Language: en-us
[
{
"fbq": "eyJ1IjoiMjY3YWYzNDEtZGY2Yy00ZWVkLTVlNzgtYTJiOGE0OWExZDFmIiwiZSI6ImIiLCJwIjoiY29ubmVjdGlvbiIsInEiOiJjb25uZWN0aW9uIiwidHMiOjE0MTM2MDgwOTksImciOm51bGwsImEiOiJzcG90bGlnaHQiLCJkIjoibWFjIiwibCI6ImVuX1VTIiwiaSI6IjE0MzQ0MS0xLDIxIiwiYyI6bnVsbCwiZWN2IjowLCJjY3YiOjB9",
"results": [
"sys_pref",
"server:eyJkIjoid2ViX3N1Z2dlc3QiLCJyIjoid2I6aHR0cDovL2Nvbm5lY3Rpb25zYWNhZGVteS5jb20ifQ==",
"dictionary",
"documents",
"folders",
"other",
"developer",
"server:eyJkIjoiYmluZyIsInIiOiJiOmh0dHAlM0ElMkYlMkZ3d3cuY29ubmVjdGlvbnNhY2FkZW15LmNvbSUyRmhvbWUuYXNweCJ9",
"server:eyJkIjoiYmluZyIsInIiOiJiOmh0dHAlM0ElMkYlMkZ3d3cuY29ubmVjdGlvbnMuY29tJTJGIn0=",
"server:eyJkIjoiYmluZyIsInIiOiJiOmh0dHAlM0ElMkYlMkZjb25uZWN0aW9uc2NsZXZlbGFuZC5vcmclMkYifQ=="
],
"timestamp": 217690,
"input": "connection",
"type": "render",
"trigger_timestamp": 217690
},
{
"latency": 406,
"input": " ",
"ttfb": 406,
"delta_ref": "spotlight_local_search",
"headers": {
"User-Agent": "(OS X 14A389) Spotlight\/916",
"X-Apple-UserGuid": "267af341-df6c-4eed-5e78-a2b8a49a1d1f",
"Accept-Charset": "utf-8",
"X-Apple-CachedResults": "[]",
"Accept-Encoding": "gzip, deflate",
"X-Apple-CachedQueries": "[]"
},
"type": "search_remote",
"timestamp": 406,
"delta": -72182,
"url": "https:\/\/api.smoot.apple.com\/search?q=+&locale=en-US&time_zone=America\/Denver&calendar=gregorian&key=andromeda"
},
{
"delta": 0,
"timestamp": 1249,
"input": "S",
"type": "search_local",
"ttfb": 0,
"latency": 83
},
{
"delta": 0,
"timestamp": 1668,
"input": "Sp",
"type": "search_local",
"ttfb": 0,
"latency": 52
},
{
"delta": 0,
"timestamp": 1841,
"input": "Spo",
"type": "search_local",
"ttfb": 0,
"latency": 50
},
{
"delta": 0,
"timestamp": 1935,
"input": "Spot",
"type": "search_local",
"ttfb": 0,
"latency": 41
},
{
"delta": 0,
"timestamp": 2151,
"input": "Spotl",
"type": "search_local",
"ttfb": 0,
"latency": 40
},
{
"delta": 0,
"timestamp": 2354,
"input": "Spotli",
"type": "search_local",
"ttfb": 0,
"latency": 44
},
{
"delta": 0,
"timestamp": 2449,
"input": "Spotlig",
"type": "search_local",
"ttfb": 0,
"latency": 35
},
{
"delta": 0,
"timestamp": 2548,
"input": "Spotligh",
"type": "search_local",
"ttfb": 0,
"latency": 36
},
{
"delta": 0,
"timestamp": 2613,
"input": "Spotlight",
"type": "search_local",
"ttfb": 0,
"latency": 38
},
{
"delta": 0,
"timestamp": 2901,
"input": "Spotlight I",
"type": "search_local",
"ttfb": 0,
"latency": 70
},
{
"delta": 0,
"timestamp": 3070,
"input": "Spotlight In",
"type": "search_local",
"ttfb": 0,
"latency": 54
},
{
"delta": 0,
"timestamp": 3151,
"input": "Spotlight Inc",
"type": "search_local",
"ttfb": 0,
"latency": 49
},
{
"delta": 0,
"timestamp": 3235,
"input": "Spotlight Ince",
"type": "search_local",
"ttfb": 0,
"latency": 53
},
{
"delta": 0,
"timestamp": 3378,
"input": "Spotlight Incep",
"type": "search_local",
"ttfb": 0,
"latency": 44
},
{
"delta": 0,
"timestamp": 3459,
"input": "Spotlight Incept",
"type": "search_local",
"ttfb": 0,
"latency": 44
},
{
"delta": 0,
"timestamp": 3571,
"input": "Spotlight Incepti",
"type": "search_local",
"ttfb": 0,
"latency": 45
},
{
"delta": 0,
"timestamp": 3642,
"input": "Spotlight Inceptio",
"type": "search_local",
"ttfb": 0,
"latency": 44
},
{
"delta": 0,
"timestamp": 3862,
"input": "Spotlight Inception",
"type": "search_local",
"ttfb": 0,
"latency": 46
},
{
"latency": 344,
"input": "Spotlight Inception",
"ttfb": 344,
"delta_ref": "spotlight_local_search",
"headers": {
"Accept-Charset": "utf-8",
"X-Apple-UI-Scale": "1.000000",
"X-Apple-CachedResults": "[]",
"X-Apple-UserGuid": "267af341-df6c-4eed-5e78-a2b8a49a1d1f",
"User-Agent": "(OS X 14A389) Spotlight\/916",
"Accept-Encoding": "gzip, deflate",
"X-Apple-CachedQueries": "[]"
},
"type": "search_web",
"timestamp": 4167,
"delta": 305,
"url": "https:\/\/api.smoot.apple.com\/websearch?q=Spotlight+Inception&locale=en-US&time_zone=America\/Denver&calendar=gregorian&key=andromeda"
},
{
"latency": 367,
"input": "Spotlight Inception",
"ttfb": 367,
"delta_ref": "spotlight_local_search",
"headers": {
"Accept-Charset": "utf-8",
"X-Apple-UI-Scale": "1.000000",
"X-Apple-CachedResults": "[]",
"X-Apple-UserGuid": "267af341-df6c-4eed-5e78-a2b8a49a1d1f",
"User-Agent": "(OS X 14A389) Spotlight\/916",
"Accept-Encoding": "gzip, deflate",
"X-Apple-CachedQueries": "[]"
},
"type": "search_remote",
"timestamp": 4188,
"delta": 326,
"url": "https:\/\/api.smoot.apple.com\/search?q=Spotlight+Inception&locale=en-US&time_zone=America\/Denver&calendar=gregorian&key=andromeda"
},
{
"results": [
"other"
],
"timestamp": 5349,
"input": "Spotlight Inception",
"type": "render",
"trigger_timestamp": 3814
},
{
"delta": 0,
"timestamp": 5553,
"input": "Spotlight Inceptio",
"type": "search_local",
"ttfb": 0,
"latency": 41
},
{
"latency": 352,
"input": "Spotlight Inceptio",
"ttfb": 352,
"delta_ref": "spotlight_local_search",
"headers": {
"Accept-Charset": "utf-8",
"X-Apple-UI-Scale": "1.000000",
"X-Apple-CachedResults": "[]",
"X-Apple-UserGuid": "267af341-df6c-4eed-5e78-a2b8a49a1d1f",
"User-Agent": "(OS X 14A389) Spotlight\/916",
"Accept-Encoding": "gzip, deflate",
"X-Apple-CachedQueries": "[]"
},
"type": "search_remote",
"timestamp": 5868,
"delta": 315,
"url": "https:\/\/api.smoot.apple.com\/search?q=Spotlight+Inceptio&locale=en-US&time_zone=America\/Denver&calendar=gregorian&key=andromeda"
},
{
"results": [
"other"
],
"timestamp": 5878,
"input": "Spotlight Inceptio",
"type": "render",
"trigger_timestamp": 5510
},
{
"latency": 406,
"input": "Spotlight Inceptio",
"ttfb": 406,
"delta_ref": "spotlight_local_search",
"headers": {
"Accept-Charset": "utf-8",
"X-Apple-UI-Scale": "1.000000",
"X-Apple-CachedResults": "[]",
"X-Apple-UserGuid": "267af341-df6c-4eed-5e78-a2b8a49a1d1f",
"User-Agent": "(OS X 14A389) Spotlight\/916",
"Accept-Encoding": "gzip, deflate",
"X-Apple-CachedQueries": "[]"
},
"type": "search_web",
"timestamp": 5922,
"delta": 369,
"url": "https:\/\/api.smoot.apple.com\/websearch?q=Spotlight+Inceptio&locale=en-US&time_zone=America\/Denver&calendar=gregorian&key=andromeda"
},
{
"results": [
"other"
],
"timestamp": 5922,
"input": "Spotlight Inceptio",
"type": "render",
"trigger_timestamp": 5510
},
{
"results": [
"other"
],
"timestamp": 7131,
"input": "Spotlight Inceptio",
"type": "render",
"trigger_timestamp": 5510
},
{
"results": [
"other"
],
"timestamp": 8144,
"input": "Spotlight Inceptio",
"type": "render",
"trigger_timestamp": 5510
},
{
"timestamp": 23933,
"input": "Spotlight Inceptio",
"type": "abandonment",
"method": "lost_focus"
},
{
"timestamp": 23933,
"input": "Spotlight Inceptio",
"type": "abandonment",
"method": "close"
}
]HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Date: Sat, 18 Oct 2014 04:58:51 GMT
Content-Length: 3
Connection: close
""
GET /search?q=Spotlight+Inceptio&locale=en-US&time_zone=America/Denver&calendar=gregorian&key=andromeda HTTP/1.1
Host: api.smoot.apple.com
Connection: keep-alive
Accept-Charset: utf-8
Accept: */*
X-Apple-UI-Scale: 1.000000
X-Apple-CachedResults: []
X-Apple-UserGuid: 267af341-df6c-4eed-5e78-a2b8a49a1d1f
User-Agent: (OS X 14A389) Spotlight/916
Accept-Language: en-us
Accept-Encoding: gzip, deflate
X-Apple-CachedQueries: []
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Cache-Control: private, max-age=300
Content-Type: application/json; charset=utf-8
Date: Sat, 18 Oct 2014 04:58:33 GMT
Content-Length: 436
Connection: close
[{"status":"NO_RESULTS","query":"Spotlight Inceptio","prefix":"Spotlight Inceptio","completion_score":189999,"fbq":"eyJ1IjoiMjY3YWYzNDEtZGY2Yy00ZWVkLTVlNzgtYTJiOGE0OWExZDFmIiwicCI6IlNwb3RsaWdodCBJbmNlcHRpbyIsInEiOiJTcG90bGlnaHQgSW5jZXB0aW8iLCJ0cyI6MTQxMzYwODMxMywiZyI6InVzL2lsbGlub2lzL2Nvb2svY2hpY2FnbyIsImEiOiJzcG90bGlnaHQiLCJkIjoibWFjIiwibCI6ImVuX1VTIiwiaSI6IjE0MzQ0MS0xLDIxIiwiYyI6IjQxLjg2NDMsLTg3LjY0NSIsImVjdiI6MCwiY2N2IjowfQ=="}]
@JoshCheek
Copy link

The big strings seem to be base64 encoded JSON.

e.g. if we take fbq from that last line:

require 'json'
JSON.parse \
  "eyJ1IjoiMjY3YWYzNDEtZGY2Yy00ZWVkLTVlNzgtYTJiOGE0OWExZDFmIiwicCI6IlNwb3RsaWdodCBJbmNlcHRpbyIsInEiOiJTcG90bGlnaHQgSW5jZXB0aW8iLCJ0cyI6MTQxMzYwODMxMywiZyI6InVzL2lsbGlub2lzL2Nvb2svY2hpY2FnbyIsImEiOiJzcG90bGlnaHQiLCJkIjoibWFjIiwibCI6ImVuX1VTIiwiaSI6IjE0MzQ0MS0xLDIxIiwiYyI6IjQxLjg2NDMsLTg3LjY0NSIsImVjdiI6MCwiY2N2IjowfQ"
    .unpack('m')
    .first
# => {"u"=>"267af341-df6c-4eed-5e78-a2b8a49a1d1f",
#     "p"=>"Spotlight Inceptio",
#     "q"=>"Spotlight Inceptio",
#     "ts"=>1413608313,
#     "g"=>"us/illinois/cook/chicago",
#     "a"=>"spotlight",
#     "d"=>"mac",
#     "l"=>"en_US",
#     "i"=>"143441-1,21",
#     "c"=>"41.8643,-87.645",
#     "ecv"=>0,
#     "ccv"=>0}

@gcs-github
Copy link

Damn, that "c" parameter in @JoshCheek 's parsed result is the location of the user. Meaning Apple also tracks your location every time you type into Spotlight. O_o

@easp
Copy link

easp commented Oct 18, 2014

As I recall, I was asked if I wanted to allow Spotlight to access my location. You can disable it in System Preferences: Security & Privacy : Privacy : Location Services : System Services

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment