Sample API Usage

You can reference FBCE library (project) to your own project to use existing APIs. The API usage is very straightforward and easy to use!

ILoginApi login = new LoginApi(() => new FacebookBrowser("/your/chrome/path"));
ICommentApi comment = new CommentApi();

// Get Facebook cookie header
var cookie = await login.LoginAsync();

// Get Facebook comments
var logger = new MyLogger();
var postUrl = "https://facebook.com/some/fb/post";
var comments = await comment.GetCommentsAsync(postUrl, cookie, logger);

foreach (var comment in comments)
{
    Console.WriteLine(comment.Text);
    Console.WriteLine(comment.SenderName);
    Console.WriteLine(comment.SenderUrl);
    Console.WriteLine(comment.ReactionsCount);
    
    foreach (var reply in comment.Replies)
    {
        Console.WriteLine(reply.Text);
        Console.WriteLine(reply.SenderName);
        Console.WriteLine(reply.SenderUrl);
        Console.WriteLine(reply.ReactionsCount);
    }
}

The source code itself contains XML documentation for public methods, classes and properties. This is makes your development become much more easier!

Last updated