Google Translate API text-to-speech: http requests forbidden












6















I am making a language learning web app that when you hover over the word, it pronounces it for you. I'd like to access the native speaker translations from Google Translate API.



I've found this resource which gives http://translate.google.com/translate_tts as the base URL and tl for target language and q for the query string.



This works awesome when I just access it in the browser,
http://translate.google.com/translate_tts?tl=zh-CN&q=你好, but any httprequests for my app return a 403 Forbidden error.




localhost:~ me$ wget
"http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"
--2015-06-02 11:02:06-- http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
Resolving translate.google.com... 173.194.123.38, 173.194.123.36,
173.194.123.32, ... Connecting to translate.google.com|173.194.123.38|:80... connected. HTTP request
sent, awaiting response... 403 Forbidden 2015-06-02 11:02:07 ERROR
403: Forbidden.




Is there a formal Google API for text-to-speech associated with their payment plans for traditional Google Translate API that I'm just not finding? Or is there a way to get and play this audio somehow?










share|improve this question



























    6















    I am making a language learning web app that when you hover over the word, it pronounces it for you. I'd like to access the native speaker translations from Google Translate API.



    I've found this resource which gives http://translate.google.com/translate_tts as the base URL and tl for target language and q for the query string.



    This works awesome when I just access it in the browser,
    http://translate.google.com/translate_tts?tl=zh-CN&q=你好, but any httprequests for my app return a 403 Forbidden error.




    localhost:~ me$ wget
    "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"
    --2015-06-02 11:02:06-- http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
    Resolving translate.google.com... 173.194.123.38, 173.194.123.36,
    173.194.123.32, ... Connecting to translate.google.com|173.194.123.38|:80... connected. HTTP request
    sent, awaiting response... 403 Forbidden 2015-06-02 11:02:07 ERROR
    403: Forbidden.




    Is there a formal Google API for text-to-speech associated with their payment plans for traditional Google Translate API that I'm just not finding? Or is there a way to get and play this audio somehow?










    share|improve this question

























      6












      6








      6


      1






      I am making a language learning web app that when you hover over the word, it pronounces it for you. I'd like to access the native speaker translations from Google Translate API.



      I've found this resource which gives http://translate.google.com/translate_tts as the base URL and tl for target language and q for the query string.



      This works awesome when I just access it in the browser,
      http://translate.google.com/translate_tts?tl=zh-CN&q=你好, but any httprequests for my app return a 403 Forbidden error.




      localhost:~ me$ wget
      "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"
      --2015-06-02 11:02:06-- http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
      Resolving translate.google.com... 173.194.123.38, 173.194.123.36,
      173.194.123.32, ... Connecting to translate.google.com|173.194.123.38|:80... connected. HTTP request
      sent, awaiting response... 403 Forbidden 2015-06-02 11:02:07 ERROR
      403: Forbidden.




      Is there a formal Google API for text-to-speech associated with their payment plans for traditional Google Translate API that I'm just not finding? Or is there a way to get and play this audio somehow?










      share|improve this question














      I am making a language learning web app that when you hover over the word, it pronounces it for you. I'd like to access the native speaker translations from Google Translate API.



      I've found this resource which gives http://translate.google.com/translate_tts as the base URL and tl for target language and q for the query string.



      This works awesome when I just access it in the browser,
      http://translate.google.com/translate_tts?tl=zh-CN&q=你好, but any httprequests for my app return a 403 Forbidden error.




      localhost:~ me$ wget
      "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"
      --2015-06-02 11:02:06-- http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world
      Resolving translate.google.com... 173.194.123.38, 173.194.123.36,
      173.194.123.32, ... Connecting to translate.google.com|173.194.123.38|:80... connected. HTTP request
      sent, awaiting response... 403 Forbidden 2015-06-02 11:02:07 ERROR
      403: Forbidden.




      Is there a formal Google API for text-to-speech associated with their payment plans for traditional Google Translate API that I'm just not finding? Or is there a way to get and play this audio somehow?







      javascript google-api text-to-speech http-status-code-403 google-translate






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 2 '15 at 15:05









      GrowlerGrowler

      4,7911266155




      4,7911266155
























          2 Answers
          2






          active

          oldest

          votes


















          4














          That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2.



          Without an api key you will receive the 403 forbidden error.



          More information here: https://cloud.google.com/translate/docs






          share|improve this answer



















          • 2





            Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

            – Growler
            Jun 2 '15 at 15:12













          • @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

            – Akshat
            Jun 2 '15 at 15:14











          • @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

            – Akshat
            Jun 2 '15 at 15:15











          • That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

            – Growler
            Jun 2 '15 at 15:18











          • @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

            – Akshat
            Jun 2 '15 at 15:19





















          2














          You can get anything sound, I found it:
          https://translate.google.com.vn/translate_tts?ie=UTF-8&q=ANYTHING_TEXT&tl=en&client=tw-ob
          Note: client=tw-ob






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30599797%2fgoogle-translate-api-text-to-speech-http-requests-forbidden%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            4














            That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2.



            Without an api key you will receive the 403 forbidden error.



            More information here: https://cloud.google.com/translate/docs






            share|improve this answer



















            • 2





              Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

              – Growler
              Jun 2 '15 at 15:12













            • @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

              – Akshat
              Jun 2 '15 at 15:14











            • @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

              – Akshat
              Jun 2 '15 at 15:15











            • That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

              – Growler
              Jun 2 '15 at 15:18











            • @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

              – Akshat
              Jun 2 '15 at 15:19


















            4














            That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2.



            Without an api key you will receive the 403 forbidden error.



            More information here: https://cloud.google.com/translate/docs






            share|improve this answer



















            • 2





              Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

              – Growler
              Jun 2 '15 at 15:12













            • @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

              – Akshat
              Jun 2 '15 at 15:14











            • @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

              – Akshat
              Jun 2 '15 at 15:15











            • That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

              – Growler
              Jun 2 '15 at 15:18











            • @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

              – Akshat
              Jun 2 '15 at 15:19
















            4












            4








            4







            That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2.



            Without an api key you will receive the 403 forbidden error.



            More information here: https://cloud.google.com/translate/docs






            share|improve this answer













            That resource is dated. Google deprecated free access to the language translate api. Now an API key is needed. The api is also now in V2.



            Without an api key you will receive the 403 forbidden error.



            More information here: https://cloud.google.com/translate/docs







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jun 2 '15 at 15:08









            AkshatAkshat

            59.3k26194256




            59.3k26194256








            • 2





              Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

              – Growler
              Jun 2 '15 at 15:12













            • @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

              – Akshat
              Jun 2 '15 at 15:14











            • @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

              – Akshat
              Jun 2 '15 at 15:15











            • That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

              – Growler
              Jun 2 '15 at 15:18











            • @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

              – Akshat
              Jun 2 '15 at 15:19
















            • 2





              Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

              – Growler
              Jun 2 '15 at 15:12













            • @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

              – Akshat
              Jun 2 '15 at 15:14











            • @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

              – Akshat
              Jun 2 '15 at 15:15











            • That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

              – Growler
              Jun 2 '15 at 15:18











            • @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

              – Akshat
              Jun 2 '15 at 15:19










            2




            2





            Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

            – Growler
            Jun 2 '15 at 15:12







            Thank you. I've looked at their API docs and didn't see any endpoints for getting text-to-speech files. Am I missing that? I'd be willing to pay if I can access the audio. Btw, you still can download the audio from the deprecated translate_tts URI using wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&tl=en&q=hello+world"

            – Growler
            Jun 2 '15 at 15:12















            @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

            – Akshat
            Jun 2 '15 at 15:14





            @Growler it's not an official api but still takes an api key. You can try get passed it using techniques from here: stackoverflow.com/questions/12883330/…. You're likely to get blocked often once you make requests with over 100 characters.

            – Akshat
            Jun 2 '15 at 15:14













            @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

            – Akshat
            Jun 2 '15 at 15:15





            @Growler I've seen that, you're likely to get blocked using it once Google detects how youre using the requests.

            – Akshat
            Jun 2 '15 at 15:15













            That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

            – Growler
            Jun 2 '15 at 15:18





            That SO post contains deprecated techniques that I used original when I posted this. The most updated technique there is from weston.ruter.net/2009/12/12/google-tts

            – Growler
            Jun 2 '15 at 15:18













            @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

            – Akshat
            Jun 2 '15 at 15:19







            @Growler that SO post is kept up to date and the link youve mentioned is from that post which still does work.

            – Akshat
            Jun 2 '15 at 15:19















            2














            You can get anything sound, I found it:
            https://translate.google.com.vn/translate_tts?ie=UTF-8&q=ANYTHING_TEXT&tl=en&client=tw-ob
            Note: client=tw-ob






            share|improve this answer




























              2














              You can get anything sound, I found it:
              https://translate.google.com.vn/translate_tts?ie=UTF-8&q=ANYTHING_TEXT&tl=en&client=tw-ob
              Note: client=tw-ob






              share|improve this answer


























                2












                2








                2







                You can get anything sound, I found it:
                https://translate.google.com.vn/translate_tts?ie=UTF-8&q=ANYTHING_TEXT&tl=en&client=tw-ob
                Note: client=tw-ob






                share|improve this answer













                You can get anything sound, I found it:
                https://translate.google.com.vn/translate_tts?ie=UTF-8&q=ANYTHING_TEXT&tl=en&client=tw-ob
                Note: client=tw-ob







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 14 '17 at 3:33









                Tan NguyenTan Nguyen

                386




                386






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f30599797%2fgoogle-translate-api-text-to-speech-http-requests-forbidden%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas