hi, i have a sysytem that gets film reviews from my DB when i search the film but i want to use an API to be able to search online aswell such as getting reviews from IMDB does anyone know how i can go about this, are there any examples anymore ?
any help would be appreciated

Dani AI

Generated

As wanted to add online reviews for analysis, the practical route is to use providers that actually expose review text (not just ratings) and to respect terms of service. was right to point to APIs; ’s reminder about permission is also important. The Movie Database (TMDb) exposes user review text via a movie reviews endpoint, which makes it a convenient source for collecting and analyzing comments. (developer.themoviedb.org) If only ratings/metadata are required, the OMDb API is a simple option, but it returns ratings and metadata rather than full review bodies. (omdbapi.com) Scraping sites like IMDb without permission is explicitly disallowed; IMDb asks developers to use its datasets or licensed feeds instead of scraping. (help.imdb.com)

Suggested workflow: register for an API key, perform a title search to get a canonical ID (TMDb or an external ID), call the review endpoint for that ID, store review id/author/date/content, and tag each record with its source. Respect provider rate limits and implement caching + exponential backoff for 429 responses. TMDb documents its rate-limit guidance and advises handling 429s gracefully. (developer.themoviedb.org) For professional critic reviews, consider licensed journalist APIs (for example the New York Times Movie Reviews API) or publisher open platforms rather than scraping. (apis.guru)

Quick PHP example (TMDb): fetch a search result, then fetch reviews for the first match.

<?php
function getJson($url){
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_USERAGENT, 'ReviewScraper/1.0');
  $body = curl_exec($ch);
  $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);
  if($code!==200) throw new Exception("HTTP $code");
  return json_decode($body, true);
}

$api = 'YOUR_TMDB_API_KEY';
$search = getJson("https://api.themoviedb.org/3/search/movie?api_key={$api}&query=" . urlencode('Inception'));
$movieId = $search['results'][0]['id'] ?? null;
$reviews = getJson("https://api.themoviedb.org/3/movie/{$movieId}/reviews?api_key={$api}&page=1");
print_r($reviews);

After collecting text, run language detection and sentiment/NLP (cloud ML services or libraries) rather than ad-hoc keyword counting. Cloud Natural Language and similar services provide robust sentiment and sentence-level scores. (docs.cloud.google.com)

Notes and cautions: log provenance (source, URL, timestamp), avoid re-publishing copyrighted content, keep cached copies short-lived if required by the provider, and request permission or a commercial license when reusing critic content.

Recommended Answers

All 5 Replies

Member Avatar for Member #120589

You want to scrape other sites and display that data? Would you need their permission? I would be surprised if not.

all i want to do is retrieve their film reviews and analyse them

See the link.

Ok thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.