### Get Top Farcaster Casts Request Example (C#) Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-top-farcaster-casts Provides a C# code example using HttpClient to make a GET request to the Talent Protocol API for fetching top Farcaster casts. Includes setting the request URL, headers, and handling the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/farcaster/farcaster_casts"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# Example - Get All Scores for a Profile Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-all-scores-for-a-profile Example of how to fetch all scores for a profile using C# HttpClient. This snippet demonstrates making a GET request to the Talent Protocol API and handling the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/scores"); request.Headers.Add("Accept", "application/json"); // Add your API key to the headers, e.g.: // request.Headers.Add("X-API-KEY", "YOUR_API_KEY"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-a-profile-using-wallet-talent-id-or-account-identifier Example of how to fetch profile data using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/profile"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example Response for Get Creator Posts Feed Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-creator-posts-feed Provides an example of the JSON response structure for the Get Creator Posts Feed API, illustrating the expected format for the 'posts' array and its properties. ```json { "posts":[ { "platform":"string", "name":"string", "onchain_address":"string", "owner_address":"string", "onchain_created_at":"2024-07-29T15:51:28.071Z", "chain":"string", "image_url":"string", "description":"string", "url":"string", "metadata":{} } ] } ``` ```json { "posts":[ { "platform":"text", "name":"text", "onchain_address":"text", "owner_address":"text", "onchain_created_at":"text", "chain":"text", "image_url":"text", "description":"text", "url":"text", "metadata":{ "text":"text" }, "profile":{ "id":"text", "bio":"text", "display_name":"text", "image_url":"text", "location":"text", "name":"text", "human_checkmark":true, "onchain_since":"2025-06-13T13:40:37.297Z", "ens":"text", "tags":[ "text" ] } } ] } ``` -------------------------------- ### Talent Protocol Support and Next Steps Source: https://docs.talentprotocol.com/docs/developers/get-started Information on how to get technical support for Talent Protocol and links to further resources, including the Talent API. ```APIDOC Support Channels: - Discord: Join for technical support. - Farcaster: Join for technical support. - Twitter: Follow @TalentProtocol for updates. Further Resources: - Talent API: Access the API for building with Talent Protocol. - Reputation Infrastructure: Learn about building reputation systems. - What Can You Build?: Explore potential applications. - Quick Start: Get started quickly with the protocol. - Core Concepts: Detailed explanation of the protocol's foundational elements. - Support: Information on obtaining assistance. ``` -------------------------------- ### Swift Example: Get Credentials Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier Example of fetching talent credentials using Swift's URLSession. ```swift import Foundation func getCredentials() { guard let url = URL(string: "https://api.talentprotocol.com/credentials") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-API-KEY") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error: \(error.localizedDescription)\n") return } guard let data = data else { return } if let responseString = String(data: data, encoding: .utf8) { print("Response: \(responseString)\n") } } task.resume() RunLoop.main.run(until: Date(timeIntervalSinceNow: 5)) // Keep the main thread alive for the task } ``` -------------------------------- ### Swift Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This Swift code snippet demonstrates how to make a GET request to the Talent Protocol API using URLSession. It sets up the URL request with the Accept header and handles the data task response. ```swift import Foundation let url = URL(string: "https://api.talentprotocol.com/accounts")! var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json", forHTTPHeaderField: "Accept") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error: \(error)") return } if let data = data { print(String(data: data, encoding: .utf8)!) } } task.resume() ``` -------------------------------- ### cURL Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This cURL command shows how to fetch account data from the Talent Protocol API. It specifies the GET request method, the API endpoint, and includes the necessary Accept header. ```curl curl -X GET "https://api.talentprotocol.com/accounts" \ -H "Accept: application/json" ``` -------------------------------- ### Shell Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This shell script uses cURL to make a GET request to the Talent Protocol API for account information. It sets the Accept header and prints the response to standard output. ```shell curl -X GET "https://api.talentprotocol.com/accounts" \ -H "Accept: application/json" ``` -------------------------------- ### Python Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This Python code snippet demonstrates how to make a GET request to the Talent Protocol API using the requests library. It includes setting the API endpoint, the Accept header, and printing the JSON response. ```python import requests url = "https://api.talentprotocol.com/accounts" headers = { "Accept": "application/json" } response = requests.get(url, headers=headers) if response.status_code == 200: print(response.json()) else: print(f"Request failed with status code: {response.status_code}") ``` -------------------------------- ### Java Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This Java code snippet shows how to retrieve account data from the Talent Protocol API using the Apache HttpClient library. It configures the GET request, sets the Accept header, executes the request, and processes the response. ```java import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; public class TalentApiClient { public static void main(String[] args) throws Exception { try (CloseableHttpClient client = HttpClients.createDefault()) { HttpGet request = new HttpGet("https://api.talentprotocol.com/accounts"); request.addHeader("Accept", "application/json"); try (CloseableHttpResponse response = client.execute(request)) { System.out.println(EntityUtils.toString(response.getEntity())); } } } } ``` -------------------------------- ### JavaScript Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This JavaScript code snippet demonstrates fetching account data from the Talent Protocol API using the fetch API. It makes a GET request to the specified endpoint with the required Accept header and logs the JSON response. ```javascript fetch('https://api.talentprotocol.com/accounts', { method: 'GET', headers: { 'Accept': 'application/json' } }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return response.json(); }) .then(data => { console.log(data); }) .catch(error => { console.error('Error fetching accounts:', error); }); ``` -------------------------------- ### Get Scorers Meta API Example Response Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-list-of-scorers An example of the JSON response returned by the 'Get scorers meta' API endpoint, showcasing sample data for two scorers. ```json { "scorers": [ { "name": "Creator Score", "slug": "creator_score", "description": "Talent Protocol creator score" }, { "name": "Builder Score", "slug": "builder_score", "description": "Talent Protocol builder score" } ] } ``` -------------------------------- ### Talent Protocol Support and Next Steps Source: https://docs.talentprotocol.com/index Provides information on how to get technical support and outlines the next steps for developers, including links to the Talent API and further documentation. ```APIDOC Support: Channels: - Discord: https://discord.gg/talentprotocol - Farcaster: https://farcaster.xyz/~/channel/talent Social Media: - Twitter: @TalentProtocol Next Steps: - Talent API: https://docs.talentprotocol.com/docs/developers/talent-api - Reputation Infrastructure: https://docs.talentprotocol.com/docs/developers/get-started#reputation-infrastructure-for-builders-and-creators - What Can You Build?: https://docs.talentprotocol.com/docs/developers/get-started#what-can-you-build - Quick Start: https://docs.talentprotocol.com/docs/developers/get-started#quick-start - Core Concepts: https://docs.talentprotocol.com/docs/developers/get-started#core-concepts - Support: https://docs.talentprotocol.com/docs/developers/get-started#support ``` -------------------------------- ### Talent Protocol API Reference Source: https://docs.talentprotocol.com/docs/developers/get-started This section provides an overview of the Talent Protocol API, including key endpoints for retrieving reputation data. It covers authentication, builder scores, and credentials. ```APIDOC API Reference: - Authentication: https://docs.talentprotocol.com/docs/developers/talent-api/authentication - Builder Score: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-a-specific-score-using-wallet-scorer-slug-talent-id-or-account-identifier - Credentials: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier ``` -------------------------------- ### Talent Protocol API Reference Source: https://docs.talentprotocol.com/index This section provides an overview of the Talent Protocol API, including key endpoints for retrieving reputation data. It covers authentication, builder scores, and credentials. ```APIDOC API Reference: - Authentication: https://docs.talentprotocol.com/docs/developers/talent-api/authentication - Builder Score: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-a-specific-score-using-wallet-scorer-slug-talent-id-or-account-identifier - Credentials: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier ``` -------------------------------- ### Talent Protocol Core Concepts Overview Source: https://docs.talentprotocol.com/docs/developers/get-started Provides a high-level overview of the core concepts that form the Talent Protocol's reputation system. It defines key entities like Profile, User, Account, Data Point, Event, and Score, explaining their roles and relationships within the protocol. ```APIDOC Profile: Description: The unified representation of a builder's identity and reputation data. Can represent a verified User or an independent Account. Relationships: - Users can have multiple connected Accounts feeding data into their Profile. - Independent Accounts have their own Profile until claimed by a User. User: Description: An individual who has signed up on one of the Talent Protocol applications and verified their identity. Relationships: - Users can connect multiple Accounts. Account: Description: A connection to a third-party data source (e.g., wallet, GitHub, X) that provides reputation data. Data Point: Description: A specific verified fact about a builder (e.g., GitHub stars, wallet transactions). Event: Description: Historical records of reputation changes. Score: Description: A numerical measure of reputation calculated from Data Points using a specific Scoring System. ``` -------------------------------- ### Objective-C Example: Get Credentials Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier Example of fetching talent credentials using Objective-C with NSURLSession. ```objective-c #import int main(int argc, const char * argv[]) { @autoreleasepool { NSURL *url = [NSURL URLWithString:@"https://api.talentprotocol.com/credentials"]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; [request setHTTPMethod:@"GET"]; [request addValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request addValue:@"YOUR_API_KEY" forHTTPHeaderField:@"X-API-KEY"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (error) { NSLog(@"Error: %@\n", error.localizedDescription); return; } NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"Response: %@\n", responseString); }]; [task resume]; [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:5]]; // Keep the main thread alive for the task } return 0; } ``` -------------------------------- ### Talent Protocol API - Getting Started Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference Details on how to authenticate and access the Talent Protocol API, including the base URL and required headers. ```APIDOC Base URL: https://api.talentprotocol.com/ Authentication: All API endpoints require authentication using your API key in the `X-API-KEY` header. ``` -------------------------------- ### C# Example: Get Creator Posts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-creator-posts-that-the-talent-profile-has-contributed-to Demonstrates how to fetch creator posts using HttpClient in C#. This snippet shows setting up the request, adding headers, sending it, and handling the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/creator_posts/profile_posts"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Curl Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using curl. ```curl curl -X GET "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=&account_source=" \ -H "Accept: application/json" \ -H "X-API-KEY: " ``` -------------------------------- ### Go Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This Go program demonstrates how to fetch account information from the Talent Protocol API using the net/http package. It constructs the request, sets the Accept header, sends the request, and prints the response body. ```go package main import ( "fmt" "io/ioutil" "net/http" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://api.talentprotocol.com/accounts", nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") resp, err := client.Do(req) if err != nil { fmt.Println(err) return } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` -------------------------------- ### R Example: Get Credentials Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier Example of fetching talent credentials using R's httr package. ```r library(httr) url <- "https://api.talentprotocol.com/credentials" headers <- c( "Accept" = "application/json", "X-API-KEY" = "YOUR_API_KEY" ) response <- GET(url, add_headers(.headers = headers)) if (http_status(response)$category == "Success") { print(content(response, "parsed")) } else { print(paste("Error:", http_status(response)$message)) } ``` -------------------------------- ### Get Projects Contributed To - C# Example Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-projects-that-the-talent-profile-has-contributed-to Example of how to fetch projects a talent profile has contributed to using C# and HttpClient. This snippet demonstrates setting up the request, adding necessary headers, sending the request, and handling the response. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/projects/contributed_projects"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Dart Example: Get Credentials Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-the-score-and-the-credentials-using-wallet-scorer-slug-talent-id-or-account-identifier Example of fetching talent credentials using Dart's http package. ```dart import 'package:http/http.dart' as http; Future getCredentials() async { final response = await http.get( Uri.parse('https://api.talentprotocol.com/credentials'), headers: { 'Accept': 'application/json', 'X-API-KEY': 'YOUR_API_KEY', }, ); if (response.statusCode == 200) { print(response.body); } else { throw Exception('Failed to load credentials'); } } ``` -------------------------------- ### C# Example: Fetching Profiles Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/search-for-profiles This C# code snippet demonstrates how to make a GET request to the Talent Protocol API to fetch profiles. It utilizes `HttpClient` to send the request and includes setting the necessary headers, such as 'Accept'. The code ensures the response is successful and prints the content to the console. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/search/advanced/profiles"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-a-project-and-its-contributors-by-slug Demonstrates how to use HttpClient in C# to make a GET request to the Talent Protocol API to fetch project and contributor data. Includes setting the request method, URL, and Accept header. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/projects/:project_slug"); request.Headers.Add("Accept", "application/json"); // Add authorization header if needed // request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "YOUR_API_KEY"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); // Throws if the response code is not 2xx var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); ``` -------------------------------- ### Swift Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using URLSession in Swift. ```swift import Foundation func getFarcasterCasts(talentId: String, apiKey: String) { guard let url = URL(string: "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=\(talentId)") else { return } var request = URLRequest(url: url) request.httpMethod = "GET" request.setValue("application/json", forHTTPHeaderField: "Accept") request.setValue(apiKey, forHTTPHeaderField: "X-API-KEY") let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error: \(error.localizedDescription)") return } guard let httpResponse = response as? HTTPURLResponse else { print("Invalid response") return } guard (200...299).contains(httpResponse.statusCode) else { print("Request failed with status: \(httpResponse.statusCode)") return } if let data = data, let responseString = String(data: data, encoding: .utf8) { print(responseString) } } task.resume() } ``` -------------------------------- ### Send API Request Example Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-a-project-and-its-contributors-by-slug Example of sending an HTTP request to the Talent Protocol API using C#. It demonstrates ensuring a successful status code and reading the response content. ```csharp var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Shell Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using curl in shell. ```shell TALENT_ID="" API_KEY="" curl -X GET "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=$TALENT_ID" \ -H "Accept: application/json" \ -H "X-API-KEY: $API_KEY" ``` -------------------------------- ### C Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using libcurl in C. ```c #include #include size_t write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) { FILE *fp = (FILE *)userdata; return fwrite(ptr, size, nmemb, fp); } int main() { CURL *curl; FILE *fp; CURLcode res; const char *url = "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id="; const char *api_key = ""; const char *header = "Accept: application/json"; const char *auth_header = "X-API-KEY: "; char auth_header_full[256]; snprintf(auth_header_full, sizeof(auth_header_full), "%s%s", auth_header, api_key); curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { fp = fopen("response.json", "wb"); curl_easy_setopt(curl, CURLOPT_URL, url); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_slist_append_file(NULL, header)); curl_easy_setopt(curl, CURLOPT_HTTPHEADER, curl_slist_append_file(NULL, auth_header_full)); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, fp); res = curl_easy_perform(curl); if(res != CURLE_OK) { fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res)); } curl_easy_cleanup(curl); fclose(fp); curl_global_cleanup(); } return 0; } ``` -------------------------------- ### Node.js Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using axios in Node.js. ```nodejs const axios = require('axios'); async function getFarcasterCasts(talentId, apiKey) { const url = `https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=${talentId}`; try { const response = await axios.get(url, { headers: { 'Accept': 'application/json', 'X-API-KEY': apiKey, }, }); console.log(response.data); } catch (error) { console.error('Error fetching Farcaster casts:', error); } } ``` -------------------------------- ### Objective-C Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using NSURLSession in Objective-C. ```objective-c #import - (void)getFarcasterCastsWithTalentId:(NSString *)talentId apiKey:(NSString *)apiKey { NSString *urlString = [NSString stringWithFormat:@"https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=%@", talentId]; NSURL *url = [NSURL URLWithString:urlString]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; request.HTTPMethod = @"GET"; [request addValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request addValue:apiKey forHTTPHeaderField:@"X-API-KEY"]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { if (error) { NSLog(@"Error: %@", error.localizedDescription); return; } NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; if (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) { NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"Response: %@", responseString); } else { NSLog(@"Request failed with status: %ld", (long)httpResponse.statusCode); } }]; [task resume]; } ``` -------------------------------- ### Ruby Example for Getting Accounts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-account-using-wallet-talent-id-or-account-identifier This Ruby code snippet shows how to fetch account data from the Talent Protocol API using the Net::HTTP library. It constructs the HTTP request, sets the necessary headers, and prints the response body. ```ruby require 'net/http' require 'uri' uri = URI.parse("https://api.talentprotocol.com/accounts") request = Net::HTTP::Get.new(uri) request["Accept"] = "application/json" response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(request) end puts response.body ``` -------------------------------- ### PHP Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using cURL in PHP. ```php ``` -------------------------------- ### OCaml Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using Cohttp_lwt_unix in OCaml. ```ocaml open Lwt.Infix let get_farcaster_casts talent_id api_key = let url = Printf.sprintf "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=%s" talent_id in let headers = Cohttp.Header.init_with "Accept" "application/json" in let headers = Cohttp.Header.add headers "X-API-KEY" api_key in Cohttp_lwt_unix.Client.get ~headers (Uri.of_string url) >>= fun (resp, body) -> let status = Cohttp.Response.status resp in if Cohttp.Code.code_of_status status = 200 then body |> Cohttp_lwt.Body.to_string |> Lwt.map (fun body_str -> print_endline body_str) else Lwt.fail_with (Printf.sprintf "Request failed with status: %s" (Cohttp.Code.string_of_status status)) ``` -------------------------------- ### PowerShell Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using Invoke-RestMethod in PowerShell. ```powershell $talentId = "" $apiKey = "" $url = "https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=$talentId" $headers = @{ "Accept" = "application/json" "X-API-KEY" = $apiKey } try { $response = Invoke-RestMethod -Uri $url -Method Get -Headers $headers $response | ConvertTo-Json } catch { Write-Error "Request failed: $($_.Exception.Message)" } ``` -------------------------------- ### C# Example for Fetching Data Issuers and Credentials Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-data-issuers-and-credentials-available Demonstrates how to use HttpClient in C# to make a GET request to the Talent Protocol API to retrieve data issuer and credential metadata. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.talentprotocol.com/data_issuers_meta"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Kotlin Example: Get Farcaster Casts Source: https://docs.talentprotocol.com/docs/developers/talent-api/api-reference/get-farcaster-casts-that-the-talent-profile-is-the-author-of Example of how to retrieve Farcaster casts using OkHttp in Kotlin. ```kotlin import okhttp3.* import java.io.IOException fun getFarcasterCasts(talentId: String, apiKey: String) { val client = OkHttpClient() val request = Request.Builder() .url("https://api.talentprotocol.com/farcaster/profile_farcaster_casts?id=$talentId") .addHeader("Accept", "application/json") .addHeader("X-API-KEY", apiKey) .build() client.newCall(request).enqueue(object : Callback { override fun onFailure(call: Call, e: IOException) { e.printStackTrace() } override fun onResponse(call: Call, response: Response) { response.use { if (it.isSuccessful) { println(it.body?.string()) } else { println("Request failed: ${it.code}") } } } }) } ```