New features and improvements are displayed here for preview purposes only.
This page is not intended for regular use and the listed features are currently unavailable.
Please enter a valid API Key.
You can find your API key on your profile page.
Search, search, or SEARCH).200 OK, even when an error occurs. Always check the success field to determine whether the request was successful. If success is false, the error details will be available in the errorMessage field.Search across all available titles including movies, TV series, episodes, and other title types. This endpoint is useful when you are not sure about the title type. For more accurate results, use Search-Movie for movies and Search-TVSeries for TV series when the title type is known.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find titles. You can search by title name, keywords, or title name with release year to improve accuracy. Examples: Leon The Professional, Inception, Inception 2010. Including the release year is recommended when multiple titles have similar names. |
Search for movies by title, or title name with release year. This endpoint is optimized for movie searches and provides more accurate results compared to the general title search endpoint.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find movies. You can search by movie title, keywords, or include the release year to improve accuracy. Examples: Inception, Leon The Professional, Inception 2010. |
Search for TV series by title, or title name with release year. This endpoint is optimized for TV series searches and provides more accurate results compared to the general title search endpoint.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find TV series. You can search by series title, keywords, or include the release year to improve accuracy. Examples: Lost, Fringe, The Leftovers 2014. |
Search for people including actors, actresses, directors, writers, and other industry professionals. This endpoint allows you to find people by name.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find people. You can search by a person's full name or partial name. Examples: Jean Reno, Mel Gibson, Natalie Portman. |
Search for TV episodes by episode title, keywords, or other episode-related information. This endpoint allows you to find individual episodes from TV series.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find TV episodes. You can search by episode title, keywords, or other related terms. Examples: london, west, gun. |
Search for production companies, studios, and other entertainment-related companies. This endpoint allows you to find companies by name.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find companies. You can search by company name or partial name. Examples: Warner Bros, Disney, ABC Studios. |
Search for keywords used to categorize movies, TV series, and episodes. This endpoint allows you to find available keywords by name.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find keywords. You can search by keyword name or related terms. Examples: gun, battle, love. |
Search across all available items including movies, TV series, TV episodes, people, companies, keywords, and other supported data types. This endpoint is useful when you do not know the exact item type you are looking for.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| expression | Required | The search expression used to find items across all supported data types. You can search by title, name, company, keyword, or other related terms. Examples: Inception, Leon, Lost. |
Advanced search across all IMDb items including Movies, TV Series, TV Episodes, Names, Companies, Keywords, and more. Supports multiple filters to narrow down results based on title type, rating, genres, release dates, credits, and additional metadata.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| Title | Optional | Filters results by title name. You can search for a specific movie, TV series, episode, or other supported title. You can also use partial titles to find matching results. |
| Title Type | Optional | Filters results by title type. Available types include movies, TV series, episodes, shorts, and other supported title categories. Type: AdvancedSearchTitleType |
| Release Date | Optional | Filters results by release date range. You can specify a start date, end date, or both. Format: YYYY-MM-DD, YYYY-MM, or YYYY |
| IMDb Rating | Optional | Filters results by IMDb rating range. You can specify minimum and maximum rating values. |
| Number of Votes | Optional | Filters results by number of votes. You can specify minimum and maximum vote counts to narrow results based on popularity. |
| Genres | Optional | Filters results by genres. Type: AdvancedSearchGenre |
| Awards & recognition | Optional | Filters results by awards and recognition. Type: AdvancedSearchAward |
| Page topic | Optional | Only include titles with the selected page topics. Type: AdvancedSearchPageTopic |
| Page topic: Alternate Versions | Optional | - Only include titles with alternative versions information. |
| Page topic: Crazy Credits | Optional | - Only include titles with crazy credits information. |
| Page topic: Goofs | Optional | - Only include titles with goofs information. |
| Page topic: Locations | Optional | - Only include titles with filming locations information. |
| Page topic: Plot | Optional | - Only include titles with plot information. |
| Page topic: Quotes | Optional | - Only include titles with quotes information. |
| Page topic: Soundtracks | Optional | - Only include titles with soundtrack information. |
| Page topic: Trivia | Optional | - Only include titles with trivia information. |
| Companies | Optional | Filters results by production companies. Type: AdvancedSearchCompany |
| Instant watch options | Optional | Filters results by available streaming options. Type: AdvancedSearchInstawatchOption |
| US certificate | Optional | Filters results by US certificate rating. Type: AdvancedSearchUSCertificate |
| Color info | Optional | Filters results by color information. Type: AdvancedSearchColorInfo |
| Country | Optional | Filters results by country. Type: AdvancedSearchCountry |
| Keywords | Optional | Filters results by keywords. You can enter one or more keywords to find titles related to specific themes or subjects. |
| Languages | Optional | Filters results by language. Type: AdvancedSearchLanguage |
| IMDb popularity rank | Optional | Filters results by IMDb popularity rank. You can specify a minimum and maximum rank value. |
| Cast or crew | Optional | Filters results by cast or crew members. You can search for titles associated with specific actors, directors, writers, or other crew members. |
| Characters | Optional | Filters results by character names. You can search for titles containing specific characters. |
| Runtime | Optional | Filters results by runtime duration. Format: minutes |
| Sound mix | Optional | Filters results by sound mix format. Type: AdvancedSearchSoundMix |
Get detailed information about a movie or TV series using its IMDb ID. The response includes basic title information, ratings, images, posters, trailers, actors, cast, and other available metadata based on selected options.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| lang | Optional | Language of the response. Default value is en (English). Some fields will be returned in the selected language. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
| options | Optional | Options to include additional information in the response. You can select extra data sections such as FullActor, FullCast, Posters, Images, Trailer, Ratings, and Wikipedia. Multiple options can be selected to customize the returned data. |
Get the complete cast and crew information for a movie or TV series using its IMDb ID. This endpoint provides detailed information about actors, directors, writers, and other crew members associated with the title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get available posters for a movie or TV series using its IMDb ID. This endpoint returns poster images and related information for the requested title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get available images for a movie or TV series using its IMDb ID. This endpoint returns image collections and related information for the requested title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb identifier. The ID can be a title ID starting with tt or a person ID starting with nm. Examples: tt1375666, nm0000154 |
Get trailer information for a movie or TV series using its IMDb ID. This endpoint returns available trailer videos and related metadata for the requested title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get rating information for a movie or TV series using its IMDb ID. This endpoint returns available ratings from IMDb and other supported rating sources.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get user rating information for a movie or TV series using its IMDb ID. This endpoint provides rating distribution data based on user votes, including the number of votes for each rating level.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get all episodes of a specific season for a TV series using its IMDb ID. This endpoint returns episode information including episode titles, numbers, release dates, ratings, and other available details.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID of the TV series. The ID must be a valid IMDb identifier starting with tt. Example: tt0411008 |
| seasonNumber | Required | The season number to retrieve episodes from. Example: 1 |
Get external website links related to a movie, TV series, or person using its IMDb ID. This endpoint returns available links to external platforms and official pages associated with the requested item.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get Wikipedia information for a movie, or TV seriesusing its IMDb ID. This endpoint returns available Wikipedia details including summaries and related information in the selected language.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| lang | Optional | Language of the response. Default value is en (English). |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get IMDb lists by list identifier. This endpoint returns titles and related information from predefined IMDb lists such as popular movies, top rated titles, trending items, and other available collections.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb list identifier. The ID must be a valid IMDb list ID starting with ls. Example: ls123456789 |
Get Metacritic reviews for a movie or TV series using its IMDb ID. This endpoint returns available critic reviews, scores, and related review information from Metacritic.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb movie ID. This service only supports movies. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get frequently asked questions and answers related to the API. This endpoint provides FAQ information and allows searching through available questions and answers.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get awards information for a movie or TV series using its IMDb ID. This endpoint returns available awards, nominations, wins, and related recognition details for the requested title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get release information for a movie using its IMDb ID. This endpoint returns available release dates, countries, release types, and other related release details.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
Get the top 250 movies ranked by IMDb users. This endpoint returns a list of the highest-rated movies with related information such as title details, ratings, and rankings.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get the top 250 TV series ranked by IMDb users. This endpoint returns a list of the highest-rated TV series with related information such as title details, ratings, and rankings.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get the top 100 most popular movies based on IMDb popularity rankings. This endpoint returns a list of currently popular movies with related information such as title details, ratings, and popularity data.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get Top 100 Most popular TVs.
LEGACY URL: https://new.tv-api.com/API/MostPopularTVs/{apiKey}
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get movies currently available in theaters. This endpoint returns a list of movies that are currently playing in cinemas with related information such as title details, release information, ratings, and other available metadata.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get upcoming movies that are scheduled for release. This endpoint returns a list of future movie releases with related information such as title details, release dates, ratings, and other available metadata.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get upcoming TV series that are scheduled for release. This endpoint returns a list of future TV series releases with related information such as title details, release dates, ratings, and other available metadata.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get upcoming TV episodes that are scheduled for release. This endpoint returns a list of future TV episodes with related information such as episode details, release dates, ratings, and associated TV series information.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get weekend box office results. This endpoint returns movie box office performance data including rankings, earnings, and related movie information.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get all-time box office results. This endpoint returns the highest-grossing movies of all time with related information such as rankings, worldwide earnings, and movie details.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Get detailed information about people in the entertainment industry such as actors, actresses, directors, writers, and other professionals using their IMDb ID. This endpoint returns available personal details and related information.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb person ID. The ID must be a valid IMDb identifier starting with nm. Example: nm0000154 |
Get awards information for a person using their IMDb ID. This endpoint returns available awards, nominations, wins, and related recognition details for actors, actresses, directors, writers, and other professionals.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb person ID. The ID must be a valid IMDb identifier starting with nm. Example: nm0000154 |
Get detailed information about a company and its associated movies. This endpoint returns company details along with related titles produced, distributed, or associated with the company.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb company ID. The ID must be a valid IMDb company identifier. Example: co0002663 |
Get movies and TV series associated with a specific keyword. This endpoint returns titles related to the requested keyword with available information such as title details, ratings, and other metadata.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | A valid keyword used to search for related movies and TV series. Example: gun |
Get the YouTube trailer URL of a movie or TV series using its IMDb ID. This endpoint returns the available trailer link from YouTube for the requested title.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| id | Required | IMDb title ID. The ID must be a valid IMDb identifier starting with tt. Example: tt1375666 |
View API usage statistics. This endpoint returns the number of daily requests made to the available services.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
Resize and optimize images using the provided image URL. This endpoint allows changing image dimensions while maintaining the original image quality and returns the resized image URL.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| size | Required | Size of the image in Width x Height format. Examples: 8x11, 16x22, 32x44, 64x88 |
| url | Required | The image URL that you want to resize. The URL must point to a valid image file. |
Resize and optimize poster images using the provided poster URL. This endpoint allows changing poster dimensions based on supported sizes while maintaining image quality and returns the resized poster image URL.
| Name | Required | Comment |
|---|---|---|
| apikey | Required | Your API Key. This parameter is required for authentication and must be included in every request. |
| size | Required | Size of the poster image. Supported sizes are available in two formats:
|
| url | Required | URL of the poster image obtained from the posters service. |
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://example.com/api/get-value?apikey=k_1234¶m1=value1");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());var options = new RestClientOptions("https://example.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/api/get-value?apikey=k_1234¶m1=value1", Method.Get);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);curl --location 'https://example.com/api/get-value?apikey=k_1234¶m1=value1'var request = http.Request('GET', Uri.parse('https://example.com/api/get-value?apikey=k_1234¶m1=value1'));
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}var request = http.Request('GET', Uri.parse('https://example.com/api/get-value?apikey=k_1234¶m1=value1'));
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/api/get-value?apikey=k_1234¶m1=value1"
method := "GET"
client := &http.Client {
}
req, err := http.NewRequest(method, url, nil)
if err != nil {
fmt.Println(err)
return
}
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}GET /api/get-value?apikey=k_1234¶m1=value1 HTTP/1.1
Host: example.comOkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://example.com/api/get-value?apikey=k_1234¶m1=value1")
.method("GET", body)
.build();
Response response = client.newCall(request).execute();Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://example.com/api/get-value?apikey=k_1234¶m1=value1")
.asString();const requestOptions = {
method: "GET",
redirect: "follow"
};
fetch("https://example.com/api/get-value?apikey=k_1234¶m1=value1", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));var settings = {
"url": "https://example.com/api/get-value?apikey=k_1234¶m1=value1",
"method": "GET",
"timeout": 0,
};
$.ajax(settings).done(function (response) {
console.log(response);
});// WARNING: For GET requests, body is set to null by browsers.
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://example.com/api/get-value?apikey=k_1234¶m1=value1");
xhr.send();val client = OkHttpClient()
val request = Request.Builder()
.url("https://example.com/api/get-value?apikey=k_1234¶m1=value1")
.build()
val response = client.newCall(request).execute()CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api/get-value?apikey=k_1234¶m1=value1");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
res = curl_easy_perform(curl);
}
curl_easy_cleanup(curl);
const axios = require('axios');
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://example.com/api/get-value?apikey=k_1234¶m1=value1',
headers: { }
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'example.com',
'path': '/api/get-value?apikey=k_1234¶m1=value1',
'headers': {
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
req.end();var request = require('request');
var options = {
'method': 'GET',
'url': 'https://example.com/api/get-value?apikey=k_1234¶m1=value1',
'headers': {
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});var unirest = require('unirest');
var req = unirest('GET', 'https://example.com/api/get-value?apikey=k_1234¶m1=value1')
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://example.com/api/get-value?apikey=k_1234¶m1=value1"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);open Lwt
open Cohttp
open Cohttp_lwt_unix
let reqBody =
let uri = Uri.of_string "https://example.com/api/get-value?apikey=k_1234¶m1=value1" in
Client.call `GET uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example.com/api/get-value?apikey=k_1234¶m1=value1',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;<?php
$client = new Client();
$request = new Request('GET', 'https://example.com/api/get-value?apikey=k_1234¶m1=value1');
$res = $client->sendAsync($request)->wait();
echo $res->getBody();<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://example.com/api/get-value?apikey=k_1234¶m1=value1');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://example.com/api/get-value?apikey=k_1234¶m1=value1');
$request->setRequestMethod('GET');
$request->setOptions(array());
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();$response = Invoke-RestMethod 'https://example.com/api/get-value?apikey=k_1234¶m1=value1' -Method 'GET' -Headers $headers
$response | ConvertTo-Jsonimport http.client
conn = http.client.HTTPSConnection("example.com")
payload = ''
headers = {}
conn.request("GET", "/api/get-value?apikey=k_1234¶m1=value1", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))import requests
url = "https://example.com/api/get-value?apikey=k_1234¶m1=value1"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)library(httr)
res <- VERB("GET", url = "https://example.com/api/get-value?apikey=k_1234¶m1=value1")
cat(content(res, 'text'))library(RCurl)
res <- getURL("https://example.com/api/get-value?apikey=k_1234¶m1=value1", .opts=list(followlocation = TRUE))
cat(res)require "uri"
require "net/http"
url = URI("https://example.com/api/get-value?apikey=k_1234¶m1=value1")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let request = client.request(reqwest::Method::GET, "https://example.com/api/get-value?apikey=k_1234¶m1=value1");
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}http --follow --timeout 3600 GET 'https://example.com/api/get-value?apikey=k_1234¶m1=value1'wget --no-check-certificate --quiet \
--method GET \
--timeout=0 \
--header '' \
'https://example.com/api/get-value?apikey=k_1234¶m1=value1'var request = URLRequest(url: URL(string: "https://example.com/api/get-value?apikey=k_1234¶m1=value1")!,timeoutInterval: Double.infinity)
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Copied: no-text |