# IMDB Advanced Scraper (`epctex/imdb-advanced-scraper`) Actor

Uncover comprehensive data on millions of movies, artists, and more with our advanced scraping tool. Extract TV episode details, descriptions, casting, artists, ratings, and more. Customize your search with filters and mappings for precise results.

- **URL**: https://apify.com/epctex/imdb-advanced-scraper.md
- **Developed by:** [epctex](https://apify.com/epctex) (community)
- **Categories:** Videos
- **Features:** Limited permissions
- **Stats:** 353 total users, 11 monthly users, 95.2% runs succeeded, 14 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $3.20 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Actor - IMDB Advanced Scraper

### IMDB Advanced scraper

Since IMDB doesn't provide a good and free API, this actor should help you to retrieve data from it. This actor can provide you with very detailed output from IMDB.

The IMDB Advanced data scraper supports the following features:

- Advanced search - Search anything using the advanced search capability.

- Search any keyword - You can search any keyword you would like to have and get the results.

- Scrape lists - Scrape any list that you'd like to get from IMDB

- Scrape any search result - You can search for keywords, artists, movies, companies, and many more!

- Scrape genres - If you want to get the most read books on a certain category or anything related to the genres, just type the URL.

- Scrape movie detail - Scrape very detailed information for each of the movies that you'd like to get.

- Scrape artist detail - Scrape any artist and their information.

### What are the advantages of this actor compared to others?

This actor is extremely optimized, very fast, and provides at least 5x more data than the other actors or projects that you might experience.

### Bugs, fixes, updates, and changelog

This scraper is under active development. If you have any feature requests you can create an issue from [here](https://github.com/epctex-support/imdb-advanced-scraper/issues).

### Input Parameters

The input of this scraper should be JSON containing the list of pages on IMDB that should be visited. Possible fields are:

- `search`: (Optional) (String) Keyword that you want to search on IMDB.

- `mode`: (Optional) (String) Mode of search. This attribute has to be initiated when a search keyword is provided. The options are: `all`, `tt` (Titles), `ep` (TV Episodes),`nm` (Names),`co` (Companies),`kw` (Keywords).

- `startUrls`: (Optional) (Array) List of IMDB URLs. You should only provide a list, title, name, search and find URLs.

- `endPage`: (Optional) (Number) Final number of page that you want to scrape. The default is `Infinite`. This applies to all `search` requests and `startUrls` individually.

- `maxItems`: (Optional) (Number) You can limit scraped items. This should be useful when you search through the big lists or search results.

- `proxy`: (Required) (Proxy Object) Proxy configuration.

- `extendOutputFunction`: (Optional) (String) Function that takes a JQuery handle ($) as an argument and returns an object with data.

- `customMapFunction`: (Optional) (String) Function that takes each object's handle as an argument and returns the object with executing the function.

This solution requires the use of **Proxy servers**, either your own proxy servers or you can use [Apify Proxy](https://www.apify.com/docs/proxy).

#### Tip

When you want to have a scrape over a specific item URL, just copy and paste the link as one of the **startUrl**.

If you would like to scrape only the first page of a list then put the link for the page and have the `endPage` as 1.

With the last approach that is explained above you can also fetch any interval of pages. If you provide the 5th page of a list and define the `endPage` parameter as 6 then you'll have the 5th and 6th pages only.

#### Compute Unit Consumption

The actor is optimized to run blazing fast and scrape many items as possible. Therefore, it forefronts all item detail requests. If the actor doesn't block very often it'll scrape 100 items in 1 minute with ~0.03-0.06 compute units.

#### IMDB Advanced Scraper Input example

```json
{
  "searchUrls":[
    "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
    "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
    "https://www.imdb.com/list/ls016522954/?ref_=nv_tvv_dvd",
    "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm",
		"https://www.imdb.com/search/title/?title_type=feature&release_date=2021-01-01,2023-07-01"
  ],
  "proxy":{
    "useApifyProxy":true
  },
  "search":"warner bro",
  "mode": "all",
  "maxItems":20
}
```

### During the Run

During the run, the actor will output messages letting you know what is going on. Each message always contains a short label specifying which page from the provided list is currently specified.
When items are loaded from the page, you should see a message about this event with a loaded item count and total item count for each page.

If you provide incorrect input to the actor, it will immediately stop with a failure state and output an explanation of what is wrong.

### IMDB Export

During the run, the actor stores results into a dataset. Each item is a separate item in the dataset.

You can manage the results in any language (Python, PHP, Node JS/NPM). See the FAQ or <a href="https://www.apify.com/docs/api" target="blank">our API reference</a> to learn more about getting results from this IMDB Advanced actor.

### Scraped IMDB Properties

The structure of each item in IMDB looks like this:

#### Title Item Detail

```json
{
	"scrapedType": "title",
	"id": "tt2172049",
	"productionStatus": {
		"currentProductionStage": {
			"id": "released",
			"text": "Released"
		},
		"productionStatusHistory": [
			{
				"status": {
					"id": "post_production",
					"text": "Post-production"
				}
			},
			{
				"status": {
					"id": "released",
					"text": "Released"
				}
			}
		],
		"restriction": null
	},
	"canHaveEpisodes": false,
	"series": null,
	"titleText": {
		"text": "Sant Barbara"
	},
	"titleType": {
		"id": "tvMovie",
		"canHaveEpisodes": false
	},
	"originalTitleText": {
		"text": "Santa Barbara"
	},
	"certificate": {
		"rating": "TV-G"
	},
	"releaseYear": {
		"year": 2012
	},
	"releaseDate": {
		"day": 4,
		"month": 12,
		"year": 2012,
		"country": {
			"id": "IT",
			"text": "Italy"
		}
	},
	"runtime": {
		"seconds": 6000
	},
	"canRate": {
		"isRatable": true
	},
	"ratingsSummary": {
		"aggregateRating": 6.7,
		"voteCount": 165,
		"topRanking": null
	},
	"meterRanking": null,
	"primaryImage": {
		"id": "rm1824601856",
		"width": 547,
		"height": 777,
		"url": "https://m.media-amazon.com/images/M/MV5BYjkwYzFiZmItZTI5ZS00NzVkLTkwYWQtMGExMmEzNWI2ZGJhXkEyXkFqcGdeQXVyMTQ3Njg3MQ@@._V1_.jpg",
		"caption": {
			"plainText": "Sant Barbara (2012)"
		}
	},
	"images": {
		"total": 3
	},
	"videos": {
		"total": 0
	},
	"primaryVideos": [],
	"externalLinks": {
		"total": 1
	},
	"metacritic": null,
	"keywords": [
		{
			"text": "female whipping"
		}
	],
	"genres": {
		"genres": [
			{
				"text": "Drama",
				"id": "Drama"
			}
		]
	},
	"plot": {
		"plotText": {
			"plainText": "Dioscuro, governor of Scandriglia, is willing to do anything to get to the Roman government. His daughter Barbara, instead she is disinterested in everything and continued her studies in astronomy from Polycarp and along with her friends: Giuliana, Tito, Crio and the soldier Claudio. With them she will starts a spiritual journey that will totally change her life, also marked by the death of her mother, making the Christian faith its raison d'etre. All this will bring it into conflict with the government, including the prefect Marciano and especially with the father who does not share her choice and that she had not predicted this future course."
		},
		"language": {
			"id": "en-US"
		}
	},
	"plotContributionLink": {
		"url": "https://contribute.imdb.com/updates?update=tt2172049:outlines.add.1.locale~en-US"
	},
	"credits": {
		"total": 54
	},
	"principalCredits": [
		{
			"totalCredits": 1,
			"category": {
				"text": "Director",
				"id": "director"
			},
			"credits": [
				{
					"name": {
						"nameText": {
							"text": "Carmine Elia"
						},
						"id": "nm0253416"
					},
					"attributes": null
				}
			]
		},
		{
			"totalCredits": 2,
			"category": {
				"text": "Writers",
				"id": "writer"
			},
			"credits": [
				{
					"name": {
						"nameText": {
							"text": "Maura Nuccetelli"
						},
						"id": "nm0637707"
					},
					"attributes": null
				},
				{
					"name": {
						"nameText": {
							"text": "Mario Ruggeri"
						},
						"id": "nm1365120"
					},
					"attributes": null
				}
			]
		},
		{
			"totalCredits": 12,
			"category": {
				"text": "Stars",
				"id": "cast"
			},
			"credits": [
				{
					"name": {
						"nameText": {
							"text": "Vanessa Hessler"
						},
						"id": "nm2057064"
					},
					"attributes": null
				},
				{
					"name": {
						"nameText": {
							"text": "Thomas Trabacchi"
						},
						"id": "nm0870384"
					},
					"attributes": null
				},
				{
					"name": {
						"nameText": {
							"text": "Massimo Wertmüller"
						},
						"id": "nm0921632"
					},
					"attributes": null
				}
			]
		}
	],
	"reviews": {
		"total": 2
	},
	"criticReviewsTotal": {
		"total": 0
	},
	"triviaTotal": {
		"total": 0
	},
	"engagementStatistics": null,
	"subNavCredits": {
		"total": 54
	},
	"subNavReviews": {
		"total": 2
	},
	"subNavTrivia": {
		"total": 0
	},
	"subNavFaqs": {
		"total": 0
	},
	"subNavTopQuestions": {
		"total": 0
	},
	"titleGenres": {
		"genres": [
			{
				"genre": {
					"text": "Drama"
				}
			}
		]
	},
	"meta": {
		"canonicalId": "tt2172049",
		"publicationStatus": "PUBLISHED"
	},
	"castPageTitle": [
		{
			"name": {
				"nameText": {
					"text": "Vanessa Hessler"
				}
			}
		},
		{
			"name": {
				"nameText": {
					"text": "Thomas Trabacchi"
				}
			}
		},
		{
			"name": {
				"nameText": {
					"text": "Massimo Wertmüller"
				}
			}
		},
		{
			"name": {
				"nameText": {
					"text": "Simone Montedoro"
				}
			}
		}
	],
	"creatorsPageTitle": [],
	"directorsPageTitle": [
		{
			"credits": [
				{
					"name": {
						"nameText": {
							"text": "Carmine Elia"
						}
					}
				}
			]
		}
	],
	"countriesOfOrigin": {
		"countries": [
			{
				"id": "IT",
				"text": "Italy"
			}
		]
	},
	"production": [
		{
			"company": {
				"id": "co0064546",
				"companyText": {
					"text": "Lux Vide"
				}
			}
		}
	],
	"featuredReviews": [
		{
			"id": "rw8978231",
			"author": {
				"nickName": "ma-cortes",
				"userId": "ur3270789"
			},
			"summary": {
				"originalText": "Brilliant and enjoyable TV movie with plenty of love and Christian joy"
			},
			"text": {
				"originalText": {
					"plaidHtml": "Expensively mounted religious production with mostly Italian cast and spectacularly filmed in Italy. Dioscuro (Wertmüller) , governor of Scandriglia, is willing to do anything to get to the Roman government. His daughter Barbara (really gorgeous fashion model Vanessa Kessler of Asterix at the Olympic Games) , instead she is disinterested in everything and continued her studies in astronomy from Polycarp (Luciano Virgilio) and along with her friends: Giuliana (Laura Roman) , Tito (Albelli) , Crio (Anagni) and the soldier Claudio (Thomas Trabacchi) . With them she will begin a spiritual journey that will totally change her life, also marked by the death of her mother, making the Christian faith its raison d&#39;etre. All this will bring it into conflict with the government, including the prefect Marciano (Thomas Trabacchi) and her father, counsellor of emperor Dioclecianus.<br/><br/>Interesting retelling at the Santa Barbara life and her teachings filled with historical and religious view point . Words that relate to early Christian attitude but they are clearly reflected throughout the film made with honest effort and great faith both from the crew and the cast. I have seen many religious historical epics ; however , I have to admit that seldom have I seen such a purely faithful movie where almost each moment is an experience. As Santa Barbara gets in trouble when she takes the Catholic faith and especially with her father and the demanding Prefect who do not share her choice and that she had not predicted this future course. Breathtaking story set in Dioclecianus times , during the bloody Christian pursuits with emphasis in religious motives , lavish costumes and adequate production design . This is an impressive story of the life of Santa Barbara filmed on a relatively grand scale , being efficiently directed by Carmine Elia . However , not completely reverential at some characters . Life of Santa Barbara is intelligently told , including glowing cinematography by Federico Schlatter , an attractive visual style , memorable but repetitive soundtrack by means of synthesizer and decent cast giving larger-than-life interpretation .<br/><br/>This TV movie is accurately based on Santa Barbara : She is often portrayed with miniature chains and a tower. As one of the Fourteen Holy Helpers, Barbara is a popular saint, perhaps best known as the patron of armourers, artillerymen, military engineers, miners and others who work with explosives because of her legend&#39;s association with lightning, and also of mathematicians. A 15th-century French version of her story credits her with thirteen miracles, many of which reflect the security she offered that her devotees would not die before getting to make confession and receiving extreme unction. Despite the legends detailing her story, the earliest references to her supposed 3rd-century life do not appear until the 7th century, and veneration of her was common, especially in the East, from the 9th century. According to the hagiographies, Barbara, the daughter of a rich pagan named Dioscorus, was carefully guarded by her father who kept her locked up in a tower in order to preserve her from the outside world. Having secretly become a Christian, she rejected an offer of marriage that she received through her father. She was born either in Heliopolis or in Nicomedia. Before going on a journey, her father commanded that a private bath-house be erected for her use near her dwelling, and during his absence, Barbara had three windows put in it, as a symbol of the Holy Trinity, instead of the two originally intended. When her father returned, she acknowledged herself to be a Christian. Dragged before the prefect of the province, Martinianus, who had her cruelly tortured, Barbara held true to her Christian faith. During the night, the dark prison was bathed in light and new miracles occurred. Every morning, her wounds were healed. Torches that were to be used to burn her went out as soon as they came near her. Finally, she was condemned to death by beheading. Her father himself carried out the death sentence. However, as punishment, he was struck by lightning on the way home and his body was consumed by flame. Barbara was buried by a Christian, Valentinus, and her tomb became the site of miracles. Saint Barbara is venerated by Catholics who face the danger of sudden and violent death at work. She is invoked against thunder and lightning and all accidents arising from explosions of gunpowder. She became the patron saint of artillerymen, armourers, military engineers, gunsmiths, and anyone else who worked with cannon and explosives. The name of the barbiturate family of pharmaceutical drugs is believed to derive from the suggestion by an artilleryman commemorating the feast of Saint Barbara in 1864, whom the chemist Adolf von Baeyer encountered at a local tavern whilst celebrating his recent discovery of the parent compound. Saint Barbara is mentioned in Federico García Lorca&#39;s play The House of Bernarda Alba (1936)."
				}
			},
			"authorRating": 6,
			"submissionDate": "2023-04-08",
			"helpfulness": {
				"upVotes": 2,
				"downVotes": 0
			}
		}
	],
	"wins": {
		"total": 0
	},
	"nominations": {
		"total": 0
	},
	"prestigiousAwardSummary": null,
	"episodes": null,
	"videoStrip": [],
	"titleMainImages": [
		{
			"id": "rm3290246912",
			"url": "https://m.media-amazon.com/images/M/MV5BYjQ2NzI0YWMtM2IyYi00YTcyLWI5MmEtMDQyNTQxODcxZDEzXkEyXkFqcGdeQXVyNzMzMjU5NDY@._V1_.jpg",
			"caption": {
				"plainText": "Sant Barbara (2012)"
			},
			"height": 799,
			"width": 607
		},
		{
			"id": "rm1824601856",
			"url": "https://m.media-amazon.com/images/M/MV5BYjkwYzFiZmItZTI5ZS00NzVkLTkwYWQtMGExMmEzNWI2ZGJhXkEyXkFqcGdeQXVyMTQ3Njg3MQ@@._V1_.jpg",
			"caption": {
				"plainText": "Sant Barbara (2012)"
			},
			"height": 777,
			"width": 547
		},
		{
			"id": "rm3474796288",
			"url": "https://m.media-amazon.com/images/M/MV5BZDI1NTY0YjQtYjgzOC00YWEwLTlmMmEtMWQ2OTg0MmIzNzU3XkEyXkFqcGdeQXVyNzMzMjU5NDY@._V1_.jpg",
			"caption": {
				"plainText": "Sant Barbara (2012)"
			},
			"height": 669,
			"width": 718
		}
	],
	"imageUploadLink": {
		"url": "https://contribute.imdb.com/image/tt2172049/add?bus=imdb&return_url=https%3A%2F%2Fwww.imdb.com%2Fclose_me&site=web"
	},
	"cast": [
		{
			"name": {
				"id": "nm2057064",
				"nameText": {
					"text": "Vanessa Hessler"
				},
				"primaryImage": {
					"url": "https://m.media-amazon.com/images/M/MV5BMTU5NDQwNTUyMF5BMl5BanBnXkFtZTcwMjgxNTcxOA@@._V1_.jpg",
					"width": 1365,
					"height": 2048
				}
			},
			"attributes": null,
			"category": {
				"id": "actress"
			},
			"characters": [
				{
					"name": "Barbara"
				}
			],
			"episodeCredits": {
				"total": 0,
				"yearRange": null
			}
		},
	],
	"writers": [
		{
			"totalCredits": 2,
			"category": {
				"text": "Writers"
			},
			"credits": [
				{
					"name": {
						"id": "nm0637707",
						"nameText": {
							"text": "Maura Nuccetelli"
						}
					},
					"attributes": null
				},
				{
					"name": {
						"id": "nm1365120",
						"nameText": {
							"text": "Mario Ruggeri"
						}
					},
					"attributes": null
				}
			]
		}
	],
	"isAdult": false,
	"moreLikeThisTitles": [
		{
			"id": "tt1327890",
			"titleText": {
				"text": "Sant'Agostino"
			},
			"titleType": {
				"id": "tvMovie",
				"text": "TV Movie",
				"canHaveEpisodes": false,
				"displayableProperty": {
					"value": {
						"plainText": "TV Movie"
					}
				}
			},
			"originalTitleText": {
				"text": "Sant'Agostino"
			},
			"primaryImage": {
				"id": "rm1889999104",
				"width": 800,
				"height": 1130,
				"url": "https://m.media-amazon.com/images/M/MV5BMjJkYTYzNDctNmUyMS00MjgyLWIyNGMtNGZkMGFiZWU4YWRjXkEyXkFqcGdeQXVyNDA5NDY4MzU@._V1_.jpg",
				"caption": {
					"plainText": "Sant'Agostino (2010)"
				}
			},
			"releaseYear": {
				"year": 2010,
				"endYear": null
			},
			"ratingsSummary": {
				"aggregateRating": 6.8,
				"voteCount": 424
			},
			"runtime": {
				"seconds": 12000
			},
			"certificate": null,
			"canRate": {
				"isRatable": true
			},
			"titleGenres": {
				"genres": [
					{
						"genre": {
							"text": "Biography"
						}
					},
					{
						"genre": {
							"text": "Drama"
						}
					},
					{
						"genre": {
							"text": "History"
						}
					}
				]
			},
			"canHaveEpisodes": false
		},
	],
	"trivia": [],
	"goofsTotal": {
		"total": 0
	},
	"goofs": [],
	"quotesTotal": {
		"total": 0
	},
	"quotes": [],
	"crazyCredits": [],
	"alternateVersions": [],
	"connections": [],
	"soundtrack": [],
	"iframeAddReviewLink": {
		"url": "https://contribute.imdb.com/review/tt2172049/add?bus=imdb&return_url=https%3A%2F%2Fwww.imdb.com%2Fclose_me&site=web"
	},
	"topQuestions": [],
	"faqs": [],
	"detailsExternalLinks": [],
	"spokenLanguages": {
		"spokenLanguages": [
			{
				"id": "it",
				"text": "Italian"
			}
		]
	},
	"akas": [
		{
			"text": "Santa Bárbara"
		}
	],
	"filmingLocations": [
		{
			"text": "Tunisia",
			"location": "Tunisia",
			"attributes": []
		}
	],
	"companies": {
		"total": 5
	},
	"productionBudget": {
		"budget": {
			"amount": 2000000,
			"currency": "EUR"
		}
	},
	"lifetimeGross": null,
	"openingWeekendGross": null,
	"worldwideGross": null,
	"technicalSpecifications": {
		"soundMixes": {
			"items": []
		},
		"aspectRatios": {
			"items": [
				{
					"aspectRatio": "16:9 HD",
					"attributes": []
				}
			]
		},
		"colorations": {
			"items": [
				{
					"conceptId": "color",
					"text": "Color",
					"attributes": []
				}
			]
		}
	},
	"contributionQuestions": [
		{
			"entity": {
				"primaryImage": {
					"url": "https://m.media-amazon.com/images/M/MV5BYjkwYzFiZmItZTI5ZS00NzVkLTkwYWQtMGExMmEzNWI2ZGJhXkEyXkFqcGdeQXVyMTQ3Njg3MQ@@._V1_.jpg",
					"width": 547,
					"height": 777,
					"caption": {
						"plainText": "Sant Barbara (2012)"
					}
				}
			},
			"questionId": "tt2172049.plot_outline.en-US",
			"questionText": {
				"plainText": "What is the English language plot outline for Sant Barbara (2012)?"
			},
			"contributionLink": {
				"url": "https://contribute.imdb.com/answers?pinnedQuestion=tt2172049.plot_outline.en-US"
			}
		}
	]
}
```

### Contact

Please visit us through [epctex.com](https://epctex.com) to see all the products that are available for you. If you are looking for any custom integration or so, please reach out to us through the chat box in [epctex.com](https://epctex.com). In need of support? <business@epctex.com> is at your service.

# Actor input Schema

## `search` (type: `string`):

The keyword that you can search on IMDB

## `mode` (type: `string`):

Search mode that you can specify your search on IMDB

## `searchTag` (type: `string`):

Search tags that you can specify your search on IMDB

## `startUrls` (type: `array`):

URLs to start with.

## `maxItems` (type: `integer`):

Maximum number of listing items that you want as output. Default is all

## `endPage` (type: `integer`):

The page number that you want to end with. By default there is no end page. This is applies to all search request and startUrls individually.

## `extendOutputFunction` (type: `string`):

Function that takes a JQuery handle ($) as argument and returns data that will be merged with the default output

## `customMapFunction` (type: `string`):

Function that takes each of the objects as argument and returns data that will be mapped by the function itself.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "search": "warner",
  "mode": "all",
  "searchTag": "all",
  "startUrls": [
    "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
    "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
    "https://www.imdb.com/list/ls566706296",
    "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm",
    "https://www.imdb.com/search/title/?title_type=feature&release_date=2021-01-01,2023-07-01"
  ],
  "maxItems": 20,
  "endPage": 1,
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }",
  "proxy": {
    "useApifyProxy": true
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "search": "warner",
    "mode": "all",
    "searchTag": "all",
    "startUrls": [
        "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
        "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
        "https://www.imdb.com/list/ls566706296",
        "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm",
        "https://www.imdb.com/search/title/?title_type=feature&release_date=2021-01-01,2023-07-01"
    ],
    "maxItems": 20,
    "endPage": 1,
    "extendOutputFunction": ($) => { return {} },
    "customMapFunction": (object) => { return {...object} },
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("epctex/imdb-advanced-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "search": "warner",
    "mode": "all",
    "searchTag": "all",
    "startUrls": [
        "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
        "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
        "https://www.imdb.com/list/ls566706296",
        "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm",
        "https://www.imdb.com/search/title/?title_type=feature&release_date=2021-01-01,2023-07-01",
    ],
    "maxItems": 20,
    "endPage": 1,
    "extendOutputFunction": "($) => { return {} }",
    "customMapFunction": "(object) => { return {...object} }",
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("epctex/imdb-advanced-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "search": "warner",
  "mode": "all",
  "searchTag": "all",
  "startUrls": [
    "https://www.imdb.com/title/tt0056234/?ref_=adv_li_tt",
    "https://www.imdb.com/name/nm0912504/?ref_=fn_al_nm_1",
    "https://www.imdb.com/list/ls566706296",
    "https://www.imdb.com/find?s=kw&q=warn&ref_=nv_sr_sm",
    "https://www.imdb.com/search/title/?title_type=feature&release_date=2021-01-01,2023-07-01"
  ],
  "maxItems": 20,
  "endPage": 1,
  "extendOutputFunction": "($) => { return {} }",
  "customMapFunction": "(object) => { return {...object} }",
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call epctex/imdb-advanced-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,epctex/imdb-advanced-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/tFtRJkJ8nIiFx2Qq7/builds/fpfcMgeCovTYzQRv0/openapi.json
