How to request Netflix Consumption History

Introduction

DataMover allows third-party apps to get data from various platforms. The example below is for Netflix.

Architecture

1. Collect user credentials

Our Netflix syncer requires user credentials and other information for the user so that it can sync data for them.

This data can be retrieved from a browser as a user logs into Netflix.

For capacitor.js apps, we recommend building a custom plugin to operate the browser. A native iOS app can use standard Swift APIs to instantiate the browser to operate the browser.

We need the following credentials and authentication information in particular:

  • auth_url — a parameter (available via window.netflix.reactContext.models.userInfo.data.authURL)


  • NetflixId cookie


  • SecureNetflixId cookie


  • country — the country in which the user resides.

2. Trigger Scrape

Share the user credentials with DataMover to trigger a scrape.

Send a POST request to {DataMover URL}.

Include a header datamover-api-key with our shared secret (DM team@koodos.com to set this up!).

Include a body with the data above:

{
  email: string,
  password: string,
  profile_id: string,
  auth_url: string,
  NetflixId: string,
  SecureNetflixId: string,
  country: string,
}

If the data passes validation (fields are present and correct), DataMover with return a 200 response.

Otherwise it will return 400.

💡 Note: DataMover does not store user credentials and only keeps them in memory for as long as needed to make the request.

3. DataMover returns the data

DataMover returns the data to your app on a custom webhook URL (email team@koodos.com).

DataMover will send each page of data back to your app. For Netflix right now, this includes: the page number, raw data taken directly from Netflix APIs, and inferred data that DataMover has found for the movie or tv show:

{
	page: number,
	consumptions: {
		raw: {
			title: string,
			videoTitle: string,
			// present for both movies and tv shows -- don't be confused!
			movieID: number,
			country: string,
			// the time in seconds when the user stopped watching the content
			bookmark: number,
			duration: number,
			// when the consumption happened
			date: number,
			deviceType: number,
			// the day when the consumption happened
			dateStr: string,
			index: number,
			topNodeId: string,
			estRating: string or number,
			rating: string or number,
			series: number,
			seriesTitle: string,
			seasonDescriptor: string
			episodeTitle: string
		}
		inferred: {
			imdbId: string,
			title: string,
			image: string,
			description: string,
			year: number,
			// present only for tv shows
			season: number,
			// present only for tv shows
			episode: number,
		}
	}[]
}

You can now use this data to understand what shows and movies your users have been watching!

FAQ

I don’t need a lot of historical information. Can I configure how many pages I receive?

Yes — let us know, and we can build this feature custom for you.