PHP examples
Categories
- 362 All Categories
- 2 Member guidelines
- 63 Ask the Community: Technical and operational questions
- 68 General
- 10 Ask the Community: Other
- 60 Report a bug
- 12 Suggest an improvement
- 7 How to get useful technical help
- 92 Frequently asked questions
- 6 Tutorials and presentations
- 26 API endpoints
- 9 News and updates
- 3 Language datasets
- 18 Review my code
[Action required] API changes announcement for existing customers
Note: This announcement applies to API customers that are registered to a Prototype and Developer plans.
Hello all!
We are writing to inform you that a new set of plans is replacing our current application plans (Prototype and Developer plans) and prices.
As of 10th May 2022, the Prototype and Developer plans will no longer be operational. Oxford Dictionaries API will offer two new plans:
- Introductory plan
- Unlimited plan
For Prototype and Developer plan customers, changes are happening between 12th April 2022 and 10th May 2022. So do not worry! You will have time to check the options and choose how you wish to proceed using our data by selecting the Introductory or Unlimited plan.
For further instructions on how to change plans, and for more information, please visit our new plans announcement page.
Link: https://developer.oxforddictionaries.com/new-plans-announcement
If you have any questions, please feel free to leave us a comment or reach us at our Contact Us page. (https://developer.oxforddictionaries.com/contact-us)
The Oxford dictionaries API team
Note: This announcement applies to API customers that are registered to a Prototype and Developer plans.
Hello all!
We are writing to inform you that a new set of plans is replacing our current application plans (Prototype and Developer plans) and prices.
As of 10th May 2022, the Prototype and Developer plans will no longer be operational. Oxford Dictionaries API will offer two new plans:
- Introductory plan
- Unlimited plan
For Prototype and Developer plan customers, changes are happening between 12th April 2022 and 10th May 2022. So do not worry! You will have time to check the options and choose how you wish to proceed using our data by selecting the Introductory or Unlimited plan.
For further instructions on how to change plans, and for more information, please visit our new plans announcement page.
Link: https://developer.oxforddictionaries.com/new-plans-announcement
If you have any questions, please feel free to leave us a comment or reach us at our Contact Us page. (https://developer.oxforddictionaries.com/contact-us)
The Oxford dictionaries API team
PHP examples

Hi.
Can you include PHP examples as you do with Objective-C ?
Taking in count that PHP is the most used web language, it makes sence to have it.
Thanks
Comments
Hi @fkrum56,
We'll certainly pass your feedback on. Meanwhile, you can always find commercial and even open source software that generates snippets of code for specific tasks in all sorts of languages. For example, I have a tool called Postman which I use to make API calls so that I can reproduce issues people are asking about on this forum; that same tool can also produce snippets of example code for the call in question. Here is the example code for an entry call (ace) using the PHP HttpRequest option:
HI there, please provide an example in CURL, the follwin g is not workign
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'app_id: xxxx',
'app_key: xxxx'
));
Hi @xenium
Have you tried the tool my former colleague mentioned above, Postman?
I understand it is a free code-snippet generator, so you might be able to get the example you need.
hi Simone, thanks for your reply. I have briefly tried Postman but not had much luck yet, I was hoping to avoid having to learn how to use it just to get a few lines of code, but if I can find the time I will do a tutorial on it and then hopefully extract some working code.
Meanwhile if anyone has an example PHP script for a call to Oxford Dictionaries API that would be amazing!
Thanks again
Ok a bit of googling + Postman later here is some PHP, seems to work fine:
$app_key = 'yourappkey';
$app_id = 'yourappid';
$auth = array("app_key: $app_key", "app_id: $app_id");
$url = "https://od-api.oxforddictionaries.com:443/api/v2";
$endpoint = "entries";
$language_code = "en-us";
$lookup_word = "simple";
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "$url/$endpoint/$language_code/$lookup_word",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => $auth,
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Hi @xenium
I'm glad it worked in the end - and many thanks for sharing the code!
Thank you Xenium, it worked for me and saved me a lot of time.