A simple PHP API for fetching entries from Ekşi Sözlük. This API allows you to retrieve entries using a simple GET request, supporting pagination and returning data in JSON format.
A simple PHP API for fetching entries from Ekşi Sözlük.
- Description
- Features
- Installation
- Usage
- Parameters
- Response Format
- Error Handling
- Examples
- License
- Contributing
This API allows you to retrieve entries from Ekşi Sözlük using a simple GET request. It returns data in JSON format, making it easy to integrate into your applications.
- Retrieves entries from specified Ekşi Sözlük titles.
- Supports pagination (specifying start and end pages).
- Option to retrieve all entries.
- Handles invalid input and provides informative error messages.
- Returns data in a structured JSON format.
- Clone the repository:
git clone https://github.com/hasanbeder/eksisozlukentryapi.git
- Place the
eksisozlukentryapi.php
file on your web server. Make sure you have PHP installed and configured.
Make a GET request to the eksisozlukentryapi.php
file with the required parameters.
https://your-domain.com/eksisozlukentryapi.php?input={eksisozluk_title_or_url}&start_page={start_page}&end_page={end_page}&get_all={true/false}
input
(required): The Ekşi Sözlük title (e.g.,example-title
) or the full URL (e.g.,https://eksisozluk.com/example-title
).start_page
(optional): The starting page number (default is 1).end_page
(optional): The ending page number (default is the last page).get_all
(optional): Set totrue
to retrieve all entries. This overridesend_page
.
The API returns a JSON response with the following structure:
{
"status": "success",
"data": [
{
"id": "entry_id",
"author": "author_username",
"date": "entry_date",
"date_link": "entry_permalink",
"author_link": "author_profile_link",
"content": "entry_content"
},
// ... more entries
]
}
In case of errors (e.g., invalid input, title not found), the API returns a JSON response with an "error" status and a descriptive message:
{
"status": "error",
"message": "Error message here"
}
-
Fetch entries from a specific title:
https://your-domain.com/eksisozlukentryapi.php?input=example-title
-
Fetch entries from a specific title, starting from page 2 and ending at page 5:
https://your-domain.com/eksisozlukentryapi.php?input=example-title&start_page=2&end_page=5
-
Fetch all entries from a specific title:
https://your-domain.com/eksisozlukentryapi.php?input=example-title&get_all=true
-
Using a full URL as input:
https://your-domain.com/eksisozlukentryapi.php?input=https://eksisozluk.com/example-title?p=1
This project is licensed under the GNU General Public License v3.
Contributions are welcome! Please feel free to submit issues and pull requests.