Skip to content

Instantly share code, notes, and snippets.

@laser
Last active August 29, 2015 14:22
Show Gist options
  • Save laser/884c05af1f7d9f5a5373 to your computer and use it in GitHub Desktop.
Save laser/884c05af1f7d9f5a5373 to your computer and use it in GitHub Desktop.
Search Service API

Search Service API

Wraps ElasticSearch in a Fandango (Express) service, exposing movie and video-searches. Allow for searching for videos and movies independent of a specific view context. Consumed by the MovieClips API.

Autocomplete (Videos)

Sample HTTP request/response (from MovieClips API):

HTTP GET http://host:1234/search/videos?q=13+Assassins&maxResults=3


HTTP 200 
application/json

[
  {
    "id": "408200771913",
    "title": "13 Assassins",
    "alternateTitle": "Official Clip - Arrow Ambush",
    "defaultImage": {
      "height": 640,
      "width": 480,
      "sourceUrl": "http://cdn.com/asset/1234.jpg"
    }
  },
  {
    "id": "408203843710",
    "title": "13 Assassins",
    "alternateTitle": "Official Clip - Forest Guide",
    "defaultImage": {
      "height": 640,
      "width": 480,
      "sourceUrl": "http://cdn.com/asset/408203843710.jpg"
    }
  },
  {
    "id": "408204867562",
    "title": "13 Assassins",
    "alternateTitle": "Official Clip - Akashi Henchmen",
    "defaultImage": {
      "height": 640,
      "width": 480,
      "sourceUrl": "http://cdn.com/asset/408204867562.jpg"
    }
  }
]

Search Results (Movies + Video ids)

Sample HTTP request/response (from MovieClips API):

HTTP GET http://host:1234/search/movies?q=Star+Trek&maxResults=3

HTTP 200 application/json
[
  {
    "id": "14273",
    "title": "Star Trek III: The Search for Spock",
    "videoIds": [
      "405603907886", "409519171966", "409519171997", "409520707763", "409520707773", 
      "409520707781", "409520707791", "409520707816", "409521219908"
    ]
  },  
  {
    "id": "16945",
    "title": "Star Trek IV: The Voyage Home",
    "videoIds": [
      "405605444002", "409519171925", "409519171973", "409519171978", "409520707750", 
      "409520707759", "409521731745", "409521731760", "409521731763", "409522755615",
      "409522755624"
    ]
  },
  {
    "id": "18041",
    "title": "Star Trek V: The Final Frontier",
    "videoIds": [
      "406771779994", "409520707918", "409521731749", "409522755620", "409522755632", 
      "409522755991", "409523267695", "409523267741", "409524291655", "409524803662" 
    ]
  },
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment