Giter Club home page Giter Club logo

linguee-api's Introduction

Linguee API

Linguee provides excellent dictionary and translation memory service. Unfortunately, there is no way you can get automated access to it. Linguee API fixes the problem. It acts as a proxy and converts their HTML responses to easy-to-use JSON API.

API endpoints

The proxy provides three API endpoints: for translations, for examples, and external sources.

Linguee API

The API documentation and the playground is available for the sample installation:

Sample installation

Sample installation is available at https://linguee-api.fly.dev.

Local installation

Install the Linguee API.

$ pip install linguee-api

Run the API server with uvicorn (installed as a dependency.)

$ uvicorn linguee_api.api:app
...
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
...

Open http://127.0.0.1:8000. You will be redirected to the API documentation page, where you can test the API.

Supported languages

API supports all the languages, supported by Linguee. As in Linguee, not all language pairs are valid though. Supported languages: bg (Bulgarian), cs (Czech), da (Danish), de (German), el (Greek), en (English), es (Spanish), et (Estonian), fi (Finnish), fr (French), hu (Hungarian), it (Italian), ja (Japan),lt (Lithuanian), lv (Latvian), mt (Maltese), nl (Dutch), pl (Polish), pt (Portuguese), ro (Romanian), ru (Russian), sk (Slovak), sl (Solvene), sv (Swedish), zh (Chinese).

Response structure

Lemmas

Every query (a random string) can match several so-called lemma objects.

According to Wikipedia, lemma is the canonical form, dictionary form, or citation form of a set of words.

In English, for example, break, breaks, broke, broken, and breaking are forms of the same lexeme, with "break" as the lemma by which they are indexed.

In the API, lemmas have the only required attribute, "text," but may have optional elements, such as part of speech ("pos") and audio links with pronunciations.

Translations

Every lemma has one or more translations. The translation is a lemma in a different language and has a similar structure with the necessary text field and optional part of speech and audio links.

Examples

In addition to lemmas, the API returns several usage examples curated by dictionary authors. Examples are the short phrases, annotated with one or more equivalents in different languages. When appropriate, examples may contain the part-of-speech form and audio links.

External Sources

On top of curated examples, Linguee provides links to external sources. The API returns objects containing the phrase snipped in the original language and an equivalent snippet in the translation.

Usage examples with Python and requests

Once installed on Heroku, Linguee API can be used as any other API service. I recommend using the requests library.

Translate a word or a phrase from one language to another with Python

A request to the sample API installation to translate the word "bacalhau" from Portuguese to English.

import requests

api_root = "https://linguee-api.fly.dev/api/v2"
resp = requests.get(f"{api_root}/translations", params={"query": "bacalhau", "src": "pt", "dst": "en"})
for lemma in resp.json():
    for translation in lemma['translations']:
        print(f"{lemma['text']} -> {translation['text']}")

This will print:

bacalhau -> cod
bacalhau -> codfish

Provide translation examples with Python

A request to the sample API installation to get all usage examples of "bacalhau" along with their translations.

import requests

api_root = "https://linguee-api.fly.dev/api/v2"

resp = requests.get(f"{api_root}/examples", params={"query": "bacalhau", "src": "pt", "dst": "en"})

for example in resp.json():
    for translation in example["translations"]:
        print(f"{example['text']} -> {translation['text']}")

This will print:

bacalhau desfiado -> shredded cod
lombo de bacalhau -> codfish fillet
...
bacalhau do Atlântico -> Atlantic cod

Get access to real world usage examples with Python

A request to the sample API installation to get all real-world usage examples of "bacalhau" along with their translations.

import requests

api_root = "https://linguee-api.fly.dev/api/v2"

resp = requests.get(f"{api_root}/external_sources", params={"query": "bacalhau", "src": "pt", "dst": "en"})
for source in resp.json():
    print(f"{source['src']} -> {source['dst']}")

This will print a long list of real-world examples like this:

É calculado o esforço de [...] pesca de todos os navios que capturam bacalhau. -> The fishing effort of all [...] the vessels catching cod will be calculated.

Bash, curl and jq usage example

Once installed on Heroku, Linguee API can be used as any other API service.

For Bash scripts you can use curl and jq, a command-line JSON parser.

Translate a word or a phrase from one language to another with Bash

A request to the sample API installation to get all usage examples of "bacalhau" along with their translations.

curl -s 'https://linguee-api.fly.dev/api/v2/translations?query=bacalhau&src=pt&dst=en' | jq -c '{text: .[].text, translation: .[].translations[].text}'

This will print

{"text":"bacalhau","translation":"cod"}
{"text":"bacalhau","translation":"codfish"}

Provide translation examples with Bash

A request to the sample API installation to get all usage examples of "bacalhau" along with their translations.

curl -s 'https://linguee-api.fly.dev/api/v2/examples?query=bacalhau&src=pt&dst=en' | jq -c '{text: .[].text, translation: .[].translations[].text}'

This will print something like this:

{"text":"bacalhau desfiado","translation":"shredded cod"}
{"text":"bacalhau desfiado","translation":"codfish fillet"}
...
{"text":"bacalhau do Atlântico","translation":"Atlantic cod"}

Get access to real world usage examples with Bash

A request to the sample API installation to get all real-world usage examples of "bacalhau" along with their translations.

curl -s 'https://linguee-api.fly.dev/api/v2/external_sources?query=bacalhau&src=pt&dst=en' | jq -c '{src: .[].src, dst: .[].dst}'

This will print a long list of real-world examples like this:

{"src":"É calculado o esforço de [...] pesca de todos os navios que capturam bacalhau.","dst":"The fishing effort of all [...] the vessels catching cod will be calculated."}
...

FAQ

The API server returns "The Linguee server returned 503"

This error means that the Linguee website temporarily blocks the API client for sending too many requests. If you use the sample API server on https://linguee-api.fly.dev, you can try to send the request later or consider installing your API server, where you won't share the same IP address with other users.

Terms and Conditions

If you use the API, make sure you comply with Linguee Terms and Conditions, and in particular with that clause:

Both private and business usage of linguee.com services is free of charge. It is however strictly prohibited to forward on our services to third parties against payment

linguee-api's People

Contributors

dependabot[bot] avatar imankulov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

linguee-api's Issues

How to get the sample sentences for a phrase?

Hello, thank you for this software, what a great idea!

I wanted to ask you: is there a way to make a query where I would simply get a list of all the sentences where a phrase is used in the native language? You know how Linguee shows it automatically when you search? So, not the translations, but, rather the contextual sentences?

Thanks!

Basic set-up and usage

Hey,

I'm afraid I don't understand how to use the API. It says the installation instructions are on the GitHub, but I don't see them. In the docs, I see some example JSON statements, but I wouldn't know how to send that, maybe with python requests, to the Linguee API.

Could you please provide more basic usage instructions?

Do we need to download anything on our system, or do we just query the API by using a library like Python requests? But what is the basic URL structure for the API then, i.e. the main address before the query suffixes are added?

Thanks very much.

Bug - Internal Server Error - Multiple "Grammar Infos"

Hi! Love this project, it has helped me a lot in my studies. I've found one bug, some words have multiple possible entries under span.tag_lemma > span.tag_lemma_context > span.placeholder > span.grammar_info but the current model only matches 0-1 time. An example word is "wünschen" (de -> en). It gives "internal error 500" on the API test page, I added a test for this word and this is the error message.

self = <xextract.parsers.String object at 0x1093db940>
nodes = [<HtmlXPathExtractor data='<span class="grammar_info">Akk</span>'>, <HtmlXPathExtractor data='<span class="grammar_info">Akk</span>'>]
context = {'url': None}

    def _process_nodes(self, nodes, context):
        # validate number of nodes
        num_nodes = len(nodes)
        if not self.quantity.check_quantity(num_nodes):
            if self.name:
                name_msg = '(name="%s")' % self.name
            else:
                name_msg = '(xpath="%s")' % self.raw_xpath
>           raise ParsingError(
                'Parser %s%s matched %s elements ("%s" expected).' %
                (self.__class__.__name__, name_msg, num_nodes, self.quantity.raw_quantity))
E           xextract.parsers.ParsingError: Parser String(name="grammar_info") matched 2 elements ("?" expected).

I've been making small modifications to add a field on my fork and found this. Not sure how to cleanly fix/didn't want to overstep, but if I do fix it I'll share how

Don't follow "Did you mean '...'?" redirection

I used linguee-api to search for some translations from English to German and experienced the following problem:
If a word is rare and there is an alternative which is syntactically close and much more frequently used in the language, Linguee offers a "Did you mean '...'?" link at the top of the search results. If this is the case, linguee-api gives the result of the redirection and not the one of the searched word.
Examples (given by the URL linguee-api is querying):
https://www.linguee.com/english-german/search?query=wit&ajax=1
https://www.linguee.com/english-german/search?query=nod&ajax=1

I guess this is not by intention? I don't know, if this behavior occurs on all cases where the result is prefixed with a "Did you mean '...'?" question.

Thanks in advance :)

Missing time variants of verbs

A very good API :)
The only missing feature are the additional information about the tense.
I have unfortunately no Python experience to implement this...

Is there a good reason why you can't grab this data?
If not, you may eventually have time and want to implement it.

Thanks for your work ;)

`inexact_matches` always returns null

Behaviour

Searching for string katz in german to english returns an empty exact_matches array and a null inexact_matches

image

Expected

Searching for an incomlete word returns an array of word suggestions as when directly using linguee webapp.

image

Explanation

Oh hai so much thanks for your repo, this thing is so cool 🍰 Sorry if I misunderstood the inexact_matches field but it is always null and I assumed it was used for something but you didn't say anything about it in your README

Bring word gender as a separate key

Hi Roman, thanks a lot for the API!
Feature request that would make this API much better than google translate API for learning new words: could you bring out the gender of the word as a separate key?
i.e. https://linguee-api.herokuapp.com/api?q=sonne&src=de&dst=en
format this

"text": "Sonne",
"word_type": "noun, feminine",

into this

"text": "Sonne",
"word_type": "noun",
"gender": "feminine"

as a bonus if you could add actual article (feminine = die, masculine = der, neuter = das), that would be total ace!

"article": "die"

get AKK indicator for German verbs

Hello,
When I do a German -> English dictionary lookup, for German verbs, I see that there are indications like "etw.Akk ~" that shows up on the front end. However, when I look for it on the JSON output, I do not see that. Is this something that can be pulled in to JSON?

Here is an example to reproduce the issue. look up the word "bringen" in German. I am adding an image below.

image

Thank you for looking into this.

Allen

Encoders error when dealing with Chinese text

Hi all,

http://127.0.0.1:8000/api/v2/external_sources?query=envisage&src=en&dst=zh
https://www.linguee.com/english-chinese/translation/envisage.html

Try translating "envisage" to Chinese. On heroku it works perfectly fine but when I install it with poetry using the instructions in /docs, I get an error. The local install works fine for most other languages, as far as I can tell, but bugs on Chinese due to some encoding problem. English to Swedish (sv) bugs as well with the error in a different place.

en to zh:

INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
2021-09-21 22:15:42.330 | INFO     | linguee_api.linguee_client:process_search_result:40 - Processing API request: query='envisage', src='en', dst='zh', guess_direction=False
INFO:     127.0.0.1:53533 - "GET /api/v2/external_sources?query=envisage&src=en&dst=zh HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 396, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\applications.py", line 199, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\applications.py", line 111, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\middleware\errors.py", line 181, in __call__
    raise exc from None
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\middleware\errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 106, in _run_asgi3    return await self._run_app(scope, lambda: self.app(scope, receive, send))
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 152, in _run_app
    raise exc from None
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 149, in _run_app
    return await callback()
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\exceptions.py", line 82, in __call__
    raise exc from None
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 566, in __call__
    await route.handle(scope, receive, send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 41, in app
    response = await func(request)
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\routing.py", line 201, in app
    raw_response = await run_endpoint_function(
  File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\routing.py", line 148, in run_endpoint_function
    return await dependant.call(**values)
  File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\api.py", line 114, in external_sources
    result = await client.process_search_result(
  File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\linguee_client.py", line 52, in process_search_result
    page_html = await self.page_downloader.download(url)
  File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\downloaders\memory_cache.py", line 18, in download
    self.cache[url] = await self.upstream.download(url)
  File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\downloaders\file_cache.py", line 21, in download
    return read_text(page_file)
  File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\utils.py", line 11, in read_text
    return content.decode(encoding)
TypeError: decode() argument 'encoding' must be str, not None

en to sv:

2021-09-21 22:17:28.899 | INFO     | linguee_api.linguee_client:process_search_result:40 - Processing API request: query='envisage', src='en', dst='sv', guess_direction=False                                                                           INFO:     127.0.0.1:53550 - "GET /api/v2/external_sources?query=envisage&src=en&dst=sv HTTP/1.1" 500 Internal Server Error                                            ERROR:    Exception in ASGI application                                            Traceback (most recent call last):                                                   File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 396, in run_asgi                                                                                      result = await app(self.scope, self.receive, self.send)                          File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 45, in __call__                                                                                      return await self.app(scope, receive, send)                                      File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\applications.py", line 199, in __call__              await super().__call__(scope, receive, send)                                     File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\applications.py", line 111, in __call__            await self.middleware_stack(scope, receive, send)                                File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\middleware\errors.py", line 181, in __call__       raise exc from None                                                              File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\middleware\errors.py", line 159, in __call__       await self.app(scope, receive, _send)                                            File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 106, in _run_asgi3                                                                                       return await self._run_app(scope, lambda: self.app(scope, receive, send))        File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 152, in _run_app      raise exc from None                                                              File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\sentry_sdk\integrations\asgi.py", line 149, in _run_app      return await callback()                                                          File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\exceptions.py", line 82, in __call__               raise exc from None                                                              File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\exceptions.py", line 71, in __call__               await self.app(scope, receive, sender)                                           File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 566, in __call__                 await route.handle(scope, receive, send)                                         File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 227, in handle                   await self.app(scope, receive, send)                                             File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\starlette\routing.py", line 41, in app                       response = await func(request)                                                   File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\routing.py", line 201, in app                        raw_response = await run_endpoint_function(                                      File "C:\Users\billi\AppData\Local\pypoetry\Cache\virtualenvs\linguee-api-_qdfDmc_-py3.9\lib\site-packages\fastapi\routing.py", line 148, in run_endpoint_function      return await dependant.call(**values)                                            File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\api.py", line 114, in external_sources                                                                  result = await client.process_search_result(                                     File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\linguee_client.py", line 52, in process_search_result                                                   page_html = await self.page_downloader.download(url)                             File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\downloaders\memory_cache.py", line 18, in download                                                      self.cache[url] = await self.upstream.download(url)                              File "C:\Users\billi\Downloads\linguee-api-master\.\linguee_api\downloaders\file_cache.py", line 20, in download                                                        page_file.write_text(page)                                                       File "C:\Users\billi\AppData\Local\Programs\Python\Python39\lib\pathlib.py", line 1276, in write_text                                                                   return f.write(data)                                                             File "C:\Users\billi\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode                                                                return codecs.charmap_encode(input,self.errors,encoding_table)[0]              UnicodeEncodeError: 'charmap' codec can't encode character '\u2326' in position 28255: character maps to <undefined>   

I've tried hardcoding 'utf-8' in line 20 of file_cache.py and line 10 of utils.py to no avail. page_html in parsers.py (line 55 gives error) is an empty string.

Two Windows 10 computers are giving the same behavior. I have not tried it with Linux yet.

What does 'featured' mean in response?

Hi, thanks a lot for your work.

But I am wondering what the True/False of 'featured' means in response.

For example, the 'featured' appearing in lemma and translations:

[{'featured': True,
  'text': 'empfangen',
  'pos': 'verb',
  'grammar_info': None,
  'audio_links': [{'url': 'https://www.linguee.com/mp3/DE/61/61b5820b33b275797b427b115ff6cc38-201.mp3',
    'lang': 'German'}],
  'translations': [{'featured': True,
    'text': 'receive',
    'pos': 'verb',
    'audio_links': [{'url': 'https://www.linguee.com/mp3/EN_US/cb/cbd71f0d3114139d38a8d080d610e5fd-200.mp3',
      'lang': 'American English'},
......

Internal Server Error

Hi Roman,
I started to test version 2 and have tried a few German words to look up translations. There are a few words that I can look up with no problem. However, I encountered issues with the following words. Could you please check? Thank you.

https://linguee-api-pr7.herokuapp.com/api/v2/translations?query=einfach&src=de&dst=en&guess_direction=false
https://linguee-api-pr7.herokuapp.com/api/v2/translations?query=Tisch&src=de&dst=en&guess_direction=false
https://linguee-api-pr7.herokuapp.com/api/v2/translations?query=M%C3%B6glichkei&src=de&dst=en&guess_direction=false

Allen

500 error for "über"

xextract.parsers.ParsingError: Parser String(name="usage_frequency") matched 2 elements ("?" expected).

looks like there are two span with tag_c class.

Official API ?

Hello is this an official api, or you just created it yourself ?

Some words just don't translate

Some examples:

https://linguee-api.fly.dev/api/v2/translations?query=bein&src=de&dst=en&guess_direction=False
https://linguee-api.fly.dev/api/v2/translations?query=Bahnhof&src=de&dst=en&guess_direction=False
https://linguee-api.fly.dev/api/v2/translations?query=beginnen&src=de&dst=en&guess_direction=False
https://linguee-api.fly.dev/api/v2/translations?query=aussehen&src=de&dst=en&guess_direction=False
https://linguee-api.fly.dev/api/v2/translations?query=Autobahn&src=de&dst=en&guess_direction=False

All returns

{
	"message": "The Linguee server returned 503"
}

But there is a translation for them
https://www.linguee.com/english-german/search?source=auto&query=Autobahn

Didn't find a patter. Am I doing something wrong?

Deploy to Heroku error

Hi, I am new to Heroku, I am using it for the first time and I am getting this error, I didn't make any changes, just clicked the deploy button, is there something I am missing?

-----> ^3.8 is not valid, please specify an exact Python version (e.g. 3.8.1) in your pyproject.toml (and thus poetry.lock)
 !     Push rejected, failed to compile Python Poetry app.
 !     Push failed

image

sounds

Hi,

is there a way to download the sound file?

Thanks

The Linguee server returned 503 for De

import requests

api_root = "https://linguee-api-v2.herokuapp.com/api/v2"
resp = requests.get(f"{api_root}/translations", params={"query": "Schere", "src": "de", "dst": "en"})
print(resp.json())

for example in resp.json():
    for translation in example["translations"]:
        print(f"{example['text']} -> {translation['text']}")

returned

{'message': 'The Linguee server returned 503'}
Traceback (most recent call last):
  File "C:\Users\Oscar\Documents\SoftwareProject\DeTranslation\LingueeAPItest.py", line 21, in <module>
    for translation in example["translations"]:
TypeError: string indices must be integers

Hope to add 'often used' property

Hi, thank you for the linguee api, I like it very much, but I find it is missing 'often used' property, could you please add them? Thank you very much!

good

image

image

image

503 Error

Certain queries return a 503 error, I don't know what the exact cause is, but it could be related #11, as the entries there all return 503.

How to install

Hello,

Would you kindly be able to give me a few pointers on how to install this? I've had a look at the documentaiton and the "playground" but it's no clearer to me how to get started. My programming skills are weak, but I think with a few pointers this tool could be useful for me learning German.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.