Closed piramiday closed 4 years ago
@piramiday I'm not aware of a way to get from a Rotten Tomatoes ID to an IMDB ID.
Here's an example JSON response from Rotten Tomatoes' search API (this request: https://79frdp12pn-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20JavaScript%20(4.4.0)%3B%20Browser%20(lite)&x-algolia-api-key=175588f6e5f8319b27702e4cc4013561&x-algolia-application-id=79FRDP12PN produced the following output for me, but your mileage may vary)
{
"results": [
{
"hits": [
{
"emsId": "d40fba4d-f6e5-3b8e-ad62-09efd03531b2",
"emsVersionId": "6db61527-2345-3ded-b7f5-363078e39157",
"tmsId": "MV000403320000",
"rtId": 12989,
"type": "movie",
"title": "The Shawshank Redemption",
"titles": [
"The Shawshank Redemption",
"Shawshank"
],
"description": "Two life sentences for a 1947 double murder land an innocent man (Tim Robbins) in a corrupt Maine penitentiary.",
"releaseYear": "1994",
"rating": "R",
"genres": [
"Drama"
],
"posterImageUrl": "https://flxt.tmsimg.com/assets/p15987_p_v10_ad.jpg",
"studios": [
"Columbia Pictures",
"Warner Bros."
],
"runTime": 142,
"rottenTomatoes": {
"audienceScore": 98,
"criticsIconUrl": "https://content6.flixster.com/static/images/rt-icons/fresh.png",
"wantToSeeCount": 99043,
"audienceIconUrl": "https://content6.flixster.com/static/images/rt-icons/red_popcorn.png",
"scoreSentiment": "POSITIVE",
"certifiedFresh": false,
"criticsScore": 90
},
"castCrew": {
"cast": [
"Tim Robbins",
"Morgan Freeman",
"Bob Gunton",
"William Sadler",
"Clancy Brown"
],
"crew": {
"Executive Producer": [
"Liz Glotzer",
"David V. Lester"
],
"Producer": [
"Niki Marvin"
],
"Screenwriter": [
"Frank Darabont"
],
"Director": [
"Frank Darabont"
]
}
},
"keywords": [
"innocent man",
"prisoner",
"warden",
"guard",
"banker",
"friend",
"powerful",
"emotional",
"gripping",
"maine",
"prison",
"mexico",
"beach",
"field",
"store",
"murder",
"escape",
"corruption",
"freedom",
"friendship",
"redemption",
"escape",
"quest",
"1960s"
],
"titleType": "main",
"typeId": 1,
"promotion": 0,
"updateDate": "2020-08-07T02:09:48.040Z",
"isEmsSearchable": 1,
"fnowId": "1MV03b5962872c34a91ad6553e83a4c0f65",
"isFnowSearchable": 1,
"definitions": [
"HD",
"SD"
],
"offers": [
{
"sku": "WBEH-fd327c84b8cc12d2",
"offerEndDate": "2049-12-31T08:00:00.000Z",
"acquisitionType": "PURCHASE",
"offerStartDate": "2018-10-09T07:00:00.000Z",
"releaseType": "MAX RESOLUTION FEATURE",
"price": 14.99,
"contentAvailDate": "2018-10-09T07:00:00.000Z",
"definitionName": "HD",
"currency": "USD",
"type": "virtual"
},
{
"sku": "WBES-b4cb243b0cfd7ac2",
"offerEndDate": "2049-12-31T08:00:00.000Z",
"acquisitionType": "PURCHASE",
"offerStartDate": "2018-10-09T07:00:00.000Z",
"releaseType": "MAX RESOLUTION FEATURE",
"price": 14.99,
"contentAvailDate": "2018-10-09T07:00:00.000Z",
"definitionName": "SD",
"currency": "USD",
"type": "virtual"
},
{
"sku": "WBVH-b293dadc9471e20c",
"offerEndDate": "2049-12-30T07:00:00.000Z",
"acquisitionType": "RENTAL",
"offerStartDate": "2019-08-23T00:56:42.000Z",
"releaseType": "MAX RESOLUTION CATALOG",
"price": 3.99,
"contentAvailDate": "2019-08-23T00:56:42.000Z",
"definitionName": "HD",
"currency": "USD",
"type": "virtual"
},
{
"sku": "WBVS-e632a120386336ae",
"offerEndDate": "2049-12-30T07:00:00.000Z",
"acquisitionType": "RENTAL",
"offerStartDate": "2019-08-23T00:56:45.000Z",
"releaseType": "MAX RESOLUTION CATALOG",
"price": 3.99,
"contentAvailDate": "2019-08-23T00:56:45.000Z",
"definitionName": "SD",
"currency": "USD",
"type": "virtual"
}
],
"fnowFlags": {
"isMA": 1,
"is4K": 0,
"is3D": 0,
"isDTS": 1,
"isIMAX": 0
},
"fnowTerms": [
"Movies Anywhere",
"DTS"
],
"fnowTitle": "The Shawshank Redemption",
"cast": [
{
"role": "Actor",
"emsId": "9d5679a4-54f6-38fc-a180-571cec482135",
"name": "Tim Robbins",
"personId": "1473"
},
{
"role": "Actor",
"emsId": "c61bf0f5-924d-3979-a419-d654c4ece6fe",
"name": "Morgan Freeman",
"personId": "47162"
},
{
"role": "Actor",
"emsId": "b736bdbb-869b-3958-b322-6043914f3a89",
"name": "Bob Gunton",
"personId": "71567"
},
{
"role": "Actor",
"emsId": "abc2a9c7-45a8-303d-ad08-b97d01689e15",
"name": "William Sadler",
"personId": "105148"
},
{
"role": "Actor",
"emsId": "3c659749-d364-3452-bc42-54f5d1a53c9b",
"name": "Clancy Brown",
"personId": "82031"
},
{
"role": "Actor",
"emsId": "2103ff7d-8445-35f8-b4b8-bf82fa389f73",
"name": "Gil Bellows",
"personId": "73436"
},
{
"role": "Actor",
"emsId": "0054deb3-83ab-37ee-b842-cfbd4ae475ca",
"name": "James Whitmore",
"personId": "29390"
},
{
"role": "Actor",
"emsId": "cf21db9e-afeb-3861-9d00-a1a6e7f9a57b",
"name": "Mark Rolston",
"personId": "43383"
},
{
"role": "Actor",
"emsId": "aa69ead4-d5e6-3a58-a79f-c013032870b5",
"name": "Jeffrey DeMunn",
"personId": "30816"
}
],
"crew": [
{
"role": "Director",
"emsId": "99a3d3b8-61c4-352c-919c-ae03fc52baf4",
"name": "Frank Darabont",
"personId": "172123"
},
{
"role": "Screenwriter",
"emsId": "99a3d3b8-61c4-352c-919c-ae03fc52baf4",
"name": "Frank Darabont",
"personId": "172123"
},
{
"role": "Executive Producer",
"emsId": "2acde5dd-7229-323e-aadd-80a77f7d3320",
"name": "Liz Glotzer",
"personId": "369927"
},
{
"role": "Executive Producer",
"emsId": "ae373cb6-f54c-311b-85ca-dfb1ce3454af",
"name": "David V. Lester",
"personId": "390797"
},
{
"role": "Producer",
"emsId": "709d022e-7c23-3ce7-b8c9-48aef2bb4a60",
"name": "Niki Marvin",
"personId": "396738"
},
{
"role": "Original Music",
"emsId": "c7e00a25-afa2-3af4-9f1c-ebe927adb8af",
"name": "Thomas Newman",
"personId": "71241"
},
{
"role": "Cinematographer",
"emsId": "6eabe43d-b711-3695-9b9e-34208ad49ffc",
"name": "Roger Deakins",
"personId": "453662"
},
{
"role": "Film Editor",
"emsId": "1afda6ac-94de-3ca3-8439-05902368a421",
"name": "Richard Francis-Bruce",
"personId": "457482"
},
{
"role": "Casting",
"emsId": "a3f0d01a-42e4-33ce-b869-9e702caccbc4",
"name": "Deborah Aquila",
"personId": "459268"
},
{
"role": "Production Designer",
"emsId": "e5e73f15-964b-31c7-ac44-f739cabf038d",
"name": "Terence Marsh",
"personId": "396244"
},
{
"role": "Art Direction",
"emsId": "122e50a2-3861-370a-8484-0e57e99bbabd",
"name": "Peter Landsdown Smith",
"personId": "463981"
},
{
"role": "Set Decoration",
"emsId": "e402d67a-f8cf-3e88-888f-43016a285001",
"name": "Michael Seirton",
"personId": "457680"
},
{
"role": "Costume Designer",
"emsId": "9b07c493-170c-31b8-b991-3d183c8fdbe8",
"name": "Elizabeth McBride",
"personId": "474808"
},
{
"role": "Production Supervisor",
"emsId": "e0435e2a-e527-3378-9dd8-a6690af48dd7",
"name": "Kokayi Ampah",
"personId": "474809"
},
{
"role": "Unit Production Manager",
"emsId": "ae373cb6-f54c-311b-85ca-dfb1ce3454af",
"name": "David V. Lester",
"personId": "390797"
},
{
"role": "Production Supervisor",
"emsId": "17d3a01d-2375-3727-9b48-4253e6645a91",
"name": "Sue Bea Montgomery",
"personId": "474810"
},
{
"role": "First Assistant Director",
"emsId": "e434700d-5f0a-33f0-92be-151e84c98f2e",
"name": "John R. Woodward",
"personId": "474811"
},
{
"role": "Sound Editor",
"emsId": "5dad7571-8793-3033-a2fd-d2b970a2fa81",
"name": "Bruce Bell",
"personId": "474812"
}
],
"vanity": "shawshank_redemption",
"aka": [
"Cadena perpetua",
"Die Verurteilten",
"En verden udenfor",
"Frihetens regn",
"Le ali della libertà",
"Les évadés",
"Nyckeln till frihet",
"Rita Hayworth - avain pakoon",
"Sueño de Fuga",
"Sueño de Libertad",
"Sueño de fuga",
"Sueño de libertad",
"Sueños de Fuga",
"Sueños de fuga",
"Sueños de libertad",
"Um Sonho de Liberdade",
"À l'ombre de Shawshank"
],
"objectID": "6db61527-2345-3ded-b7f5-363078e39157",
"_highlightResult": {
"title": {
"value": "The <em>Shawshank</em> Redemption",
"matchLevel": "full",
"fullyHighlighted": false,
"matchedWords": [
"shawshank"
]
},
"titles": [
{
"value": "The <em>Shawshank</em> Redemption",
"matchLevel": "full",
"fullyHighlighted": false,
"matchedWords": [
"shawshank"
]
},
{
"value": "<em>Shawshank</em>",
"matchLevel": "full",
"fullyHighlighted": true,
"matchedWords": [
"shawshank"
]
}
],
"description": {
"value": "Two life sentences for a 1947 double murder land an innocent man (Tim Robbins) in a corrupt Maine penitentiary.",
"matchLevel": "none",
"matchedWords": []
},
"genres": [
{
"value": "Drama",
"matchLevel": "none",
"matchedWords": []
}
],
"studios": [
{
"value": "Columbia Pictures",
"matchLevel": "none",
"matchedWords": []
},
{
"value": "Warner Bros.",
"matchLevel": "none",
"matchedWords": []
}
],
"castCrew": {
"cast": [
{
"value": "Tim Robbins",
"matchLevel": "none",
"matchedWords": []
},
{
"value": "Morgan Freeman",
"matchLevel": "none",
"matchedWords": []
},
{
"value": "Bob Gunton",
"matchLevel": "none",
"matchedWords": []
},
{
"value": "William Sadler",
"matchLevel": "none",
"matchedWords": []
},
{
"value": "Clancy Brown",
"matchLevel": "none",
"matchedWords": []
}
],
"crew": {
"Director": [
{
"value": "Frank Darabont",
"matchLevel": "none",
"matchedWords": []
}
]
}
}
}
},
],
"nbHits": 10,
"page": 0,
"nbPages": 2,
"hitsPerPage": 5,
"exhaustiveNbHits": true,
"query": "shawshank",
"params": "query=shawshank&filters=rtId%20%3E%200%20AND%20isEmsSearchable%20%3D%201&hitsPerPage=5&analyticsTags=%5B%22header_search%22%5D",
"index": "people_rt",
"processingTimeMS": 4
}
]
}
Note that there looks to be a tmsId
value - if this value is the same thing as a Gracenote ID then you might be able to find a way to map this value to an IMDB id, but I'm not certain.
thanks for your answer, but I don't think it's possible to do that from either IMDb or RT, since both services are extremely jealous or their "data".
FYI: most people rely on WikiData to store the relevant identifiers and link them together -- if the info is there, it works like a charm.
There is an API at flixster.com that contains the IMDB id/url and the rottentomatoes id. Flixster seems to use the same database as rottentomatoes.
You can search for movies like this:
https://flixster.com/api/ems/v2/search/movies?query={query}&size={resultsPerPage}&page=0
Example: https://flixster.com/api/ems/v2/search/movies?query=last+jedi&size=10&page=0
Or if you have the emsId
already, you can use
https://flixster.com/api/ems/v2/emsId/{emsId}
Example: https://flixster.com/api/ems/v2/emsId/d40fba4d-f6e5-3b8e-ad62-09efd03531b2
Edit: Changed www.flixster.com to flixster.com
great, thanks for sharing.
do you have any idea whether there is some documentation for such APIs? I have found this but it seems to be from a third party.
specifically, I was wondering whether it was possible to search in the RT/Flixster DB based on the IMDb ID, rather than a search query string.
I don't think any of these APIs are supposed to used by the public so I don't think there is any documentation.
It looks like the link you posted is the same API although it has more methods. Maybe it outdated or some of the methods require some kind of authentication.
I found it by searching through the javascript code of www.flixster.com and found this file: https://www.flixster.com/_next/static/chunks/5d84843ecbc6ef7c7e91fe28eb2fa8588831cc12.2231fbcf1113e597aaf5.js It contains some information on the API. For example the two methods I used are listed like this:
{
movie: {
pathname: "/v2/emsId/:emsId",
methods: ["GET"]
},
searchMovies: {
pathname: "/v2/search/movies",
methods: ["GET"],
defaultQuery: {
query: "",
size: 5,
page: 1
}
}
}
hey @jaebradley, I've just discovered this project and I really love it. I, too, have bumped my head against the metaphorical wall of RottenTomatoes APIs, so I'm happy to learn you have found a workaround to get some results.
specifically, I'm interested in the connection between IMDb and RottenTomatoes, among other things. can you think of a way to be able to fetch right away the RT identifier, starting from the IMDB identifier? it used to be possible, then RT decided to lock down its APIs and, well, everything changed.
if it's not possible -- and feel free to refer me to other projects, as well -- I'll try to use your code to query RT and then tentatively discover the right URL.