Important: Please read the Qt Code of Conduct -

Need help youtube APIs with qt

  • hi

    i need some links where i can learn how to use youtube APIs with qt.i google it but i could not find any useful links. Please help

  • Basically, you need to send some HTTP request using e.g. QNetworkAccessManager, then parse the received data.

    For example, if you send a HTTP GET request like this:

    You can get a ATOM-formatted reply, containing the query result, from which you can parse e.g. the URL of the content and thumbnail, etc., then you can send another request to get the data.

  • thanks but any link would be help full

  • well i have used youtube api in past with PHP. i know how to do this in PHP. but i need to how can i access youtube stuff using QT. I mean i need some examples. if there are any links for this then provide it here i ll really appreciate that.

  • doforumda: Were you able to do it with Qt?? please sher if you got any success

  • doforumda, here goes some basic samples to send some request:
    @class MyObject : public QObject
    explicit MyObject(QObject *parent = 0);

    private slots:
    void processReply();

    MyObject::MyObject(QObject *parent) :
    QNetworkAccessManager *nam = new QNetworkAccessManager(this);

    QNetworkRequest request;
    QNetworkReply *reply = nam->get(request);
    connect(reply, SIGNAL(finished()), SLOT(processReply()));


    void MyObject::processReply()
    QNetworkReply *reply = static_cast<QNetworkReply *>(sender());

    if (reply->error() != QNetworkReply::NoError) {
        qDebug() << "Error found: " << reply->error();
    QByteArray content = reply->readAll();
    qDebug() << content;
    // Here, you can use, e.g. QXmlStreamReader, to parse the received content


Log in to reply